# Example: Creating a parameterized part
class ParametricPart:
def __init__(self, **dimensions):
self.dimensions = dimensions
def create_sketch(self, points):
"""Create 2D profile from points"""
return {
"type": "sketch",
"entities": points,
"constraints": []
}
def extrude(self, sketch, depth):
"""Extrude sketch to create 3D feature"""
return {
"type": "extrude",
"profile": sketch,
"depth": depth,
"direction": "positive"
}
def create_hole(self, location, diameter, depth):
"""Create a hole feature"""
return {
"type": "hole",
"center": location,
"diameter": diameter,
"depth": depth
}
# Assembly constraint types
ASSEMBLY_CONSTRAINTS = {
"mate": {
"description": "Two faces in contact, opposite directions",
"degrees_removed": 3
},
"flush": {
"description": "Two faces coplanar",
"degrees_removed": 2
},
"angle": {
"description": "Constrained angular relationship",
"degrees_removed": 2
},
"insert": {
"description": "Axial insertion (e.g., pin in hole)",
"degrees_removed": 2
}
}