| We will now try a simple example using Draw. |
Launch the Draw executable.
Draw displays, prompts and waits for commands.
Example
# create two views : 2d and axonometric
Draw[1]> av2d
# create a 2d circle
Draw[2]> circle c 0 0 1 0 5
Draw[3]> 2dfit
# trim the circle and dump it
Draw[4]> trim c c 0 pi/2
Draw[5]> dump c
0*********** Dump of c *************
Trimmed curve
Parameters : 0 1.5707963267949
Basis curve :
Circle
Center :0, 0
XAxis :1, 0
YAxis :-0, 1
Radius :5
# create a 3d circle from it, and convert it into a bspline
Draw[6]> to3d c c
Draw[7]> fit
Draw[8]> convert c c
Draw[9]> dump c
0*********** Dump of c *************
BSplineCurve rational
Degree 2, 3 Poles, 2 Knots
Poles :
1 : 5, 0, 0 1
2 : 5, 5, 0 0.707106781186548
3 : 3.06161699786838e-16, 5, 0 1
Knots :
1 : 0 3
2 : 1.5707963267949 3
# create a surface of revolution from the spline
Draw[10]> fit
Draw[11]> help rev
reverse : reverse name ...
revsurf : revsurf name curvename x y z dx dy dz
# here you must click on the curve
Draw[12]> revsurf s . 5 5 0 -1 1 0
Pick an object
Draw[13]> fit
# rotate the view
Draw[14]> u
Draw[15]> erase c
c
# build a bspline surface and intersect it with a plane
Draw[20]> convert s s
Draw[21]> fit
Draw[22]> plane p 5 5 5 1 1 1 1 0 0
Draw[23]> intersect c p s
# pick on one of the intersection curves
# you may get c_2 instead of c_1
Draw[24]> whatis .
Pick an object
c_1 is a 3d curve
Draw[25]> clear
Draw[27]> rename c_1 c
Draw[28]> fit
# save the curve, use any directory where you can write
Draw[29]> datadir $env(WBCONTAINER)/data/default
/adv_20/BAG/data/default
Draw[30]> save c curveinter
c
Draw[31]> exit
|
|