Your First Sketch
2D Sketches are often the first step in making a 3D operation. Extrusions, and Lathe all start with a 2D sketch.
To create a sketch, you can use the Sketch
class. You will need to specify the
plane that the sketch will be on. As a starting Point you can use the origin
planes that can access using part.xy()
, part.yz()
, and part.xz()
.
As you saw in the first example, on a Sketch you can create Points and Lines.
You can also use the sketch.pencil
to make it easier to draw lines.
We can also use the pencil
attribute of the Sketch
. The pencil object has
methods for moving in absolute coordinates (move_to
) as well as relatively
(move
) and drawing lines (line_to
), which are used in a loop to draw the
star shape. Once the shape is drawn, you can extract the Polygon
using the
get_closed_polygon
.
As you can see we are also using import numpy as np
to perform maths
operations.
You can also use many tools to create more complex Sketches. Extrusion require a closed shape but you can make use of many of the already available shapes:
Rectangle
Square
Circle
Ellipse
Hexagon
Polygon