BASIC / PLASTIC-ENCLOSURE
Plastic Enclosure
A shelled enclosure with native plastic design features
Model preview
Rebuilds the supplied enclosure with the normal SCPF Box sketch/extrusion, followed by native Shell, Lip, Snap Fit, Boss and Rest features.
Key dimensions: 80 × 50 × 30 mm; 2 mm wall; two Ø7 × 12 bosses
SolidCraft model
Open in SolidCraft Web
The editable .sc model is loaded directly from the accepted build branch.
Source
SCPF source
The exact SCPF Python source declared by this build variant.
scpf/model.py
class Enclosure:
"""Rebuild the SolidCraft plastic enclosure with native plastic features."""
length = 80.0
width = 50.0
height = 30.0
wall = 2.0
def build(self):
enclosure = Box(self.length, self.width, self.height, anchor=Anchor.BOTTOM)
enclosure = enclosure.shell(self.wall, open=Faces.TOP)
lip = Lip(width=1, height=2).attach(
enclosure,
parent=Anchor.TOP,
offset=(X.MIN + 1, Y.CENTER),
)
enclosure = enclosure + lip
snap = SnapFit(
length=14,
thickness=1.5,
width=6,
catch_depth=1,
catch_length=2,
hook=(0, -1, 0),
).attach(
enclosure,
parent=Anchor.INNER_BOTTOM,
offset=(X.CENTER, Y.MAX - 6),
)
enclosure = enclosure + snap
boss1 = Boss(d=7, h=12, hole_d=2.5).attach(
enclosure,
parent=Anchor.INNER_BOTTOM,
offset=(X.MIN + 10, Y.MIN + 10),
)
enclosure = enclosure + boss1
boss2 = Boss(d=7, h=12, hole_d=2.5).attach(
enclosure,
parent=Anchor.INNER_BOTTOM,
offset=(X.MAX - 10, Y.MAX - 10),
)
enclosure = enclosure + boss2
rest = Rest(width=16, length=24, height=3).attach(
enclosure,
parent=Anchor.INNER_BOTTOM,
)
return enclosure + rest
Generated output SolidCraft command sequence 12 generated operations · expand to inspect
parameters.add{ "expression": "80", "name": "length", "unit": "mm" }parameters.add{ "expression": "50", "name": "width", "unit": "mm" }parameters.add{ "expression": "30", "name": "height", "unit": "mm" }parameters.add{ "expression": "2", "name": "wall", "unit": "mm" }solid.box{ "body_name": "Enclosure", "corner": [ "-length / 2", "-width / 2", 0 ], "height": "height", "length": "length", "width": "width" }model.faces{ "body": "Enclosure" }solid.shell{ "body": "Enclosure", "faces": [ "$topology_face_name_1" ], "thickness": "wall" }plastic.lip{ "body": "Enclosure", "face": [ -39, 0, 30 ], "height": 2, "width": 1 }plastic.snap_fit{ "body": "Enclosure", "catch_depth": 1, "catch_length": 2, "hook": [ 0, -1, 0 ], "length": 14, "position": [ 0, 19, 2 ], "thickness": 1.5, "width": 6 }plastic.boss{ "body": "Enclosure", "diameter": 7, "height": 12, "hole_diameter": 2.5, "position": [ -30, -15, 2 ] }plastic.boss{ "body": "Enclosure", "diameter": 7, "height": 12, "hole_diameter": 2.5, "position": [ 30, 15, 2 ] }plastic.rest{ "body": "Enclosure", "height": 3, "length": 24, "position": [ 0, 0, 2 ], "width": 16 }
Durable build evidence
Build information
- Build scope
main- Build variant
plastic-enclosure- Physical owner
plastic-enclosure- Built source
1f2fdb32d67d9af42779500c949f2900ee59c7ae- Forge
v0.23.0 ·- SolidCraft
0.49.0- Runtime
ghcr.io/brainboxemb/cad-solidcraft:v0.3.6
