Reworked the core examples to exclude contributed examples.
This commit is contained in:
27
examples/Ex010_Defining_an_Edge_with_a_Spline.py
Normal file
27
examples/Ex010_Defining_an_Edge_with_a_Spline.py
Normal file
@ -0,0 +1,27 @@
|
||||
import cadquery as cq
|
||||
|
||||
# 1. Establishes a workplane to create the spline on to extrude.
|
||||
# 1a. Uses the X and Y origins to define the workplane, meaning that the
|
||||
# positive Z direction is "up", and the negative Z direction is "down".
|
||||
s = cq.Workplane("XY")
|
||||
|
||||
# The points that the spline will pass through
|
||||
sPnts = [
|
||||
(2.75, 1.5),
|
||||
(2.5, 1.75),
|
||||
(2.0, 1.5),
|
||||
(1.5, 1.0),
|
||||
(1.0, 1.25),
|
||||
(0.5, 1.0),
|
||||
(0, 1.0)
|
||||
]
|
||||
|
||||
# 2. Generate our plate with the spline feature and make sure it is a
|
||||
# closed entity
|
||||
r = s.lineTo(3.0, 0).lineTo(3.0, 1.0).spline(sPnts).close()
|
||||
|
||||
# 3. Extrude to turn the wire into a plate
|
||||
result = r.extrude(0.5)
|
||||
|
||||
# Displays the result of this script
|
||||
show_object(result)
|
Reference in New Issue
Block a user