Editing Sketch
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
[[category:tutorials]] | [[category:tutorials]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
Sketches are presently usually created and edited using the graphical sketch editor interface. The sketch editor interface should display whenever a sketch is created via the Create menu or whenever an existing sketch primitive is selected for editing. | Sketches are presently usually created and edited using the graphical sketch editor interface. The sketch editor interface should display whenever a sketch is created via the Create menu or whenever an existing sketch primitive is selected for editing. | ||
Line 11: | Line 6: | ||
One of the better ways to describe the format of the sketch primitive is with an example. Here's a mildly detailed sketch that contains lots of points and several entity types. Shown in following is a case where we have a simple sketch named "mysketch". If you run the "get" command, you can see the overall structure: | One of the better ways to describe the format of the sketch primitive is with an example. Here's a mildly detailed sketch that contains lots of points and several entity types. Shown in following is a case where we have a simple sketch named "mysketch". If you run the "get" command, you can see the overall structure: | ||
− | |||
<pre> | <pre> | ||
mged> get mysketch | mged> get mysketch | ||
+ | sketch V {0 0 -4.999999999999999646464397e-40} A {1 0 0} B {0 1 0} VL { {0.59800664451827234557868 -4.674418604651163100527356} {2.501661129568105934595224 -1.833887043189368792894811} {6.259136212624585304808988 -3.109634551495016552280504} {2.581395348837209002823556 -3.209302325581395720632827} {5.830564784053156479615154 -5.571428571428572062984586} {5.521594684385382478808424 -1.764119601328903774728474} {2.531561461794019862736604 -0.9966777408637871316088308} {0.1594684385382059976787872 0.2691029900332225777148665} {-2.720930232558139483245441 -1.495016611295681085991305} {1.764119601328903774728474 -1.016611295681063120710519} {0.239202657807309121418271 -2.730897009966777755352041} {1.9634551495016612232547 -2.501661129568106378684433} {-1.265780730897009931368302 -2.611295681063122930964937} } SL { { line S 0 E 1 } { carc S 2 E 1 R -1 L 0 O 0 } { bezier D 3 P { 1 3 4 5 } } { carc S 5 E 6 R 1.644755298192071224505639 L 0 O 0 } { line S 6 E 7 } { bezier D 6 P { 7 8 9 10 11 12 0 } } } | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
Most of that is floating point conversion goo of course, but it boils down to what is shown in following with a V position, AxB vectors to scale/orient the sketch, a VL list of 2D vertices, and then any number of SL segment lists for lines, arcs, and bezier curves. Note that the 'sketch' prefix is not the name of the primitive but, rather, its type. | Most of that is floating point conversion goo of course, but it boils down to what is shown in following with a V position, AxB vectors to scale/orient the sketch, a VL list of 2D vertices, and then any number of SL segment lists for lines, arcs, and bezier curves. Note that the 'sketch' prefix is not the name of the primitive but, rather, its type. | ||
Line 88: | Line 79: | ||
</pre> | </pre> | ||
− | You can create one by writing out the sketch as one long Tcl line but instead of " | + | You can create one by writing out the sketch as one long Tcl line but instead of "get", you'd use put to create/update a sketch. Example box: |
<pre> | <pre> | ||
− | mged> put mysketch2 sketch V {0 0 0} A {1 0 0} B {0 1 0} VL { {0 0} {1 0} {1 1} {0 1} } SL { | + | mged> put mysketch2 sketch V {0 0 0} A {1 0 0} B {0 1 0} VL { {0 0} {1 0} {1 1} {0 1} } SL { {line S 0 E 1} {line S 1 E 2} {line S 2 E 3} {line S 3 E 0} } |
− | |||
</pre> | </pre> | ||
Line 98: | Line 88: | ||
<pre> | <pre> | ||
− | mged> put mysketch3 sketch V {0 0 0} A {1 0 0} B {0 1 0} VL { {0 0} {1 0} {1 1} {0 1} } SL { | + | mged> put mysketch3 sketch V {0 0 0} A {1 0 0} B {0 1 0} VL { {0 0} {1 0} {1 1} {0 1} } SL { {line S 0 E 1} {carc S 1 E 2 R 1 L 0 O 0} {line S 2 E 3} {carc S 3 E 0 R 1 L 0 O 0} } |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | There is | + | There is of course plenty of room for improvement when it comes to creating, editing, and managing sketches and sketch data. Contributions are always welcome! |