Version 0.60.0

sketch

A two-dimensional curve drawing.

Details

A sketch is a set of two-dimensional curves. It can be generated by adding multiple curves to the sketch.

Example

 curve c1 = <[8,0]> -> arc( <[0,0]>, 2PI )
 curve c2 = <[4,3]> -> arc( <[3,3]>, 2PI )
 curve c3 = <[-4,3]> -> arc( <[-3,3]>, 2PI )
 curve c4 = <[5,-1.5]> -> arc_to( <[-5,-1.5]>, 5.5, false ) -> arc_to( <[5,-1.5]>, 5.2 )

 sketch s = c1 - c2 - c3 - c4
 

A smiley contour sketch.

Example

 s.replace( 3, rotation( <[0,-3]>, <[0,0,1]>, PI ) >> s.element(3) )
 make extrusion( s, <[0,0,1]> )
 

Result of the second example illustrating the use of the replace and element members.

Casts To

string

Members

int length()

Returns the number of elements (i.e. curves) the sketch contains.

curve element( int n )

Returns the element with index n.

void replace( int n, curve c )

Replaces the element with index n of the sketch with a new curve c.

selectbox min_bbox()

Returns the axis-aligned minimum bounding box of the sketch.

See also

🗙

Search results for