-
Notifications
You must be signed in to change notification settings - Fork 6
CheatSheet
Ben Gruver edited this page Feb 17, 2019
·
2 revisions
import adsk.core, adsk.fusion
from fscad import *
def design():
sphere = Sphere(1)
sphere.create_occurrence(True, scale=.1)
def run(_):
run_design(design, message_box_on_error=False, document_name=__name__)
Box(x, y, z)
Cylinder(height, radius)
-
# A Cone
Cylinder(height, bottom_radius, top_radius)
Sphere(radius)
Union(component1, component2, ...)
Intersection(component1, component2, ...)
Difference(component1, component2, ...)
-
# groups multiple components together into a single component, but doesn't merge them into a single body like Union
Combination(component1, component2, ...)
-
-
minimum -
~
middle -
+
maximum
-
component1.place(~component1 == ~component2, # align the midpoint of component 1 with the midpoint of component 2 in the x axis -component1 == -component2, # align the min point of component 1 with the min point of component 2 in the y axis +component1 == +component2) # align the max point (top) of component 1 with the max point of component 2 in the z axis
-
with offsets
component1.place((~component1 == ~component2) + 10, # align the midpoints, with an additional offset of 10 (-component1 == -component2) - 2, # align the min points, with an additional offset of -2 (+component1 == +component2) + 1) # align the max points, with an additional offset of 1
-
place at a specific numeric location
component1.place(~component1 == 10, # place the mid x point at x=10 -component1 == 5, # place the min y point at y=5 +component1 == -10) # place the max z point at z=-10
-
and of course, you can mix and match operators
component1.place(~component1 == +component2, -component1 == ~component2, +component1 == -component2)
Chamfer([edge1, edge2, ...], chamfer_distance)
- For an unequal chamfer:
Chamfer([edge1, edge2, ...], chamfer_distance, chamfer_distance2)
Fillet([edge1, edge2, ...], radius)
Extrude(planar_entity, height)
- Extrudes planar_entity until it intersects with entity
ExtrudeTo(planar_entity, entity)
Loft(planar_component1, planar_component2, ...)
- Normally, you can use component.scale() for uniform scaling. This object allows for non-uniform scaling.
Scale(component, x, y, z)
- Splits the faces of component where they intersection with splitting_tool
SplitFace(component, splitting_tool)
- Allows the creation of threads on a cylindrical face
Threads(cylindrical_entity, thread_profile, pitch)
thread_profile is specified as a list of 2d tuples. e.g. for a basic 45 degree triangular cross section with pitch 1:
[(0, 0), (.5, .5), (0, 1)]