Skip to content

BASIC / PLASTIC-ENCLOSURE

Plastic Enclosure

A shelled enclosure with native plastic design features

Built in SolidCraft 0.49.0 12 commands

Model preview

Plastic Enclosure SolidCraft build

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

Open in SolidCraft Web

The editable .sc model is loaded directly from the accepted build branch.

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
SolidCraft command sequence 12 generated operations · expand to inspect
  1. parameters.add
    {
       "expression": "80",
       "name": "length",
       "unit": "mm"
    }
    
  2. parameters.add
    {
       "expression": "50",
       "name": "width",
       "unit": "mm"
    }
    
  3. parameters.add
    {
       "expression": "30",
       "name": "height",
       "unit": "mm"
    }
    
  4. parameters.add
    {
       "expression": "2",
       "name": "wall",
       "unit": "mm"
    }
    
  5. solid.box
    {
       "body_name": "Enclosure",
       "corner": [
          "-length / 2",
          "-width / 2",
          0
       ],
       "height": "height",
       "length": "length",
       "width": "width"
    }
    
  6. model.faces
    {
       "body": "Enclosure"
    }
    
  7. solid.shell
    {
       "body": "Enclosure",
       "faces": [
          "$topology_face_name_1"
       ],
       "thickness": "wall"
    }
    
  8. plastic.lip
    {
       "body": "Enclosure",
       "face": [
          -39,
          0,
          30
       ],
       "height": 2,
       "width": 1
    }
    
  9. 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
    }
    
  10. plastic.boss
    {
       "body": "Enclosure",
       "diameter": 7,
       "height": 12,
       "hole_diameter": 2.5,
       "position": [
          -30,
          -15,
          2
       ]
    }
    
  11. plastic.boss
    {
       "body": "Enclosure",
       "diameter": 7,
       "height": 12,
       "hole_diameter": 2.5,
       "position": [
          30,
          15,
          2
       ]
    }
    
  12. plastic.rest
    {
       "body": "Enclosure",
       "height": 3,
       "length": 24,
       "position": [
          0,
          0,
          2
       ],
       "width": 16
    }
    

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