โ† Back to list

๐Ÿ“ฆ Overview of the Enclosure Feature

The Enclosure Generation Tool (/enclosure) is a high-level design utility that automatically constructs a custom, protective 2-part shellโ€ฆ

Manoj Kumar ยท 2026-05-22 16:27 ยท 0 claps ยท 3.1 min read
#enclosure #3d-printing #pcb #truegeometry
Open on Medium โ†—
Wiki topics: ๐Ÿ“Ÿ ยท Gadgets & IoT ๐Ÿ“ ยท Mathematics

Enclosure Module www.truegeometry.com

Enclosure Module www.truegeometry.com

๐Ÿ“ฆ Overview of the Enclosure Feature

The **Enclosure Generation Tool (/enclosure) is a high-level design utility that automatically constructs a custom, protective 2-part shell (comprising an Enclosure Base and an Enclosure Lid**) around any designated 3D component or sub-assembly. Here is exactly how it operates:

1. Command Syntax & Options

  • /enclosure [type] @Target
  • [type] values: box, cylinder, shrinkwrap, or auto
  • @Target is the reference key for the component to enclose (e.g., @MyPCB or @MySensor).

2. Automatic Shape Inference

If you provide auto or omit the type, the algorithm detects the target shapeโ€™s classification (userData.shapeType):

  • Rotational/Spherical Targets (revolutions, cylinders, cones, spheres, toruses) automatically resolve to a highly fitting cylindrical enclosure.
  • Prismatic/Planar Targets default to a standard box enclosure.

3. Parametric Clearances & Walls

  • Standard Box / Cylinder Enclosure: Styled with a 4.0mm clearance margin (ensuring safe separation from the target structure) and a 2.0mm solid wall thickness.
  • Shrinkwrap Enclosure: Designed for tight-fitting skin covers, offering an ultra-low 0.5mm clearance and a lightweight 1.0mm wall thickness.

4. Advanced CSG Operations & Corner Flanges

  • The system creates mounting pillars on the corners/sides of the base using Constructive Solid Geometry (CSG) unions.
  • Each pillar includes a pre-drilled 1.2mm pilot hole (radius) housed inside a 2.5mm screw post to anchor self-tapping fasteners.
  • Interference Removal: The tool subtracts the physical target meshโ€™s interior dimensions directly from the enclosure halves so connectors, pins, and protruding details create perfect self-relieving clearances inside.

How the Enclosure Feature Works

The /enclosure command generates a fully structural, two-part protective casing (a matching Base and a Lid) around any existing 3D target shape in your scene.

Behind the scenes, the generation process uses the following pipeline:

  1. Dynamic Bounding Analysis: The tool calculates the strict bounding box and geometric midpoint of your target component (e.g., a PCB module, sensor, or structural cylinder).
  2. Clearance and Thickness Logic:
  • Standard Enclosures (box or cylinder): Applies a 4mm clearance around the object to ensure the casing holds the part comfortably, and sets a outer wall thickness of 2mm.
  • Tight Enclosures (shrinkwrap): Applies a thin 0.5mm clearance with a 1.0mm wall thickness for form-fitting shells.
  1. Internal Cutout and CSG (Constructive Solid Geometry): The tool takes solid geometries of the offset bounding dimensions, hollows them out using internal substractions, and automatically cuts a nesting slot in the base.
  2. Mounting Screw Posts: It automatically generates 4 corner mounting screw posts on the base half (with pre-drawn 1.2mm pilot holes) and matching screw bosses on the lid.
  3. Exploded View Presentation: Once generated, the lid is automatically offset slightly upward so you can peer into the casing and see the internal screw mounts and nesting space.

Interactive Examples to Test the Feature

Option A: Running the Automated Demo Script

The fastest way to test this feature is by executing the pre-built automated script. Type this command directly into the chat:

/tg_test_ui build enclosure_demo

This will run an animated walk-through that:

  1. Spawns a box representing a PCB board.
  2. Runs /enclosure box @MyPCB to construct a 2-part enclosure with corner mounting alignment holes.
  3. Spawns a cylinder representing a Sensor module.
  4. Runs /enclosure shrinkwrap @MySensor to produce a tight-fitting form casing.

Option B: Step-by-Step Manual Commands

If you want to manually build your own enclosure, you can run these commands in the chat interface sequentially:

Step 1. Create a dummy electronic component (e.g., a blue PCB board):

/parametric box 40 10 20

Step 2. Name your component โ€œ@MyComponentโ€ to target it:

/tag_last MyComponent

Step 3. Create a box enclosure around the component:

/enclosure box @MyComponent

Note: This generates two new objects in your scene tree: @MyComponent_Enclosure_Base and @MyComponent_Enclosure_Lid.

Export Commands:

/export_glb all
/export_stl all

Supported Arguments & Parameters

/enclosure [type] @Target
  • type: Optional. Can be box, cylinder, shrinkwrap, or omitted for auto (auto-detects if your parent model is spherical/cylindrical to choose the best container geometry).
  • @Target: The named object to wrap (e.g., @MyPCB). Ensure you have named your target object first using /tag_last [Name].

๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
2d5fcb58e7ba
slug
overview-of-the-enclosure-feature-2d5fcb58e7ba
url
https://medium.com/@manoj_68475/overview-of-the-enclosure-feature-2d5fcb58e7ba
canonical_url
https://medium.com/@manoj_68475/overview-of-the-enclosure-feature-2d5fcb58e7ba
author_url
https://medium.com/@manoj_68475
status
ok
fetched_at
2026-08-09 13:14:48