Prepare print model

From pjt222/agent-almanac · View interactive version

Prepare print model is an AI agent skill from the GitHub repository pjt222/agent-almanac. Export and optimize 3D models for FDM/SLA printing including STL/3MF export, mesh integrity verification, wall thickness checking, support generation, and slicing. Use when exporting from CAD or modeling software for 3D printing, verifying STL/3MF files are printable before slicing, troubleshooting

How to use this skill

Skill file

Prepare Print Model

Export and optimize 3D models for additive manufacturing. This skill covers the complete workflow from CAD/modeling software export through mesh repair, printability analysis, support generation, and slicer configuration. Ensures models are manifold, have adequate wall thickness, and are properly oriented for strength and print quality.

When to Use

Inputs

Procedure

1. Export Model from Source Software

Export the 3D model in a suitable format for printing:

For FDM/SLA:

If starting from CAD (Fusion 360, SolidWorks)

Export as: STL (binary) or 3MF

Resolution: High (triangle count sufficient for detail)

Units: mm (verify scale)

Example export settings:

STL: Binary format, refinement 0.1mm

3MF: Include color/material data if using multi-material printer

Got: Model file exported with appropriate resolution (0.1mm chord tolerance for mechanical parts, 0.05mm for organic shapes).

If fail: Check that model is fully defined (no construction geometry), no missing faces, all components visible.

2. Verify Mesh Integrity

Check that the mesh is manifold and printable:

# Install mesh repair tools if needed
# sudo apt install meshlab admesh

# Check STL file for errors
admesh --check model.stl

# Look for:
# - Non-manifold edges: 0 (every edge connects exactly 2 faces)
# - Holes: 0
# - Backwards/inverted normals: 0
# - Degenerate facets: 0

Common issues:

Got: Report shows 0 errors, or errors are repairable.

If fail: Repair mesh automatically or manually:

# Automatic repair with admesh
admesh --write-binary-stl=model_fixed.stl \
       --exact \
       --nearby \
       --remove-unconnected \
       --fill-holes \
       --normal-directions \
       model.stl

# Or use meshlab GUI for manual inspection/repair
meshlab model.stl
# Filters → Cleaning and Repairing → Remove Duplicate Vertices
# Filters → Cleaning and Repairing → Remove Duplicate Faces
# Filters → Normals → Re-Orient all faces coherently

If automatic repair fails, return to source software and fix modeling errors (coincident vertices, open edges, overlapping bodies).

3. Check Wall Thickness

Verify minimum wall thickness for chosen process:

Minimum wall thickness by process:

| Process | Min Wall | Recommended Min | Structural Parts |

|---|---|---|---|

| FDM (0.4mm nozzle) | 0.8mm | 1.2mm | 2.4mm+ |

| FDM (0.6mm nozzle) | 1.2mm | 1.8mm | 3.6mm+ |

| SLA (standard) | 0.4mm | 0.8mm | 2.0mm+ |

| SLA (engineering) | 0.6mm | 1.2mm | 2.5mm+ |

| SLS (nylon) | 0.7mm | 1.0mm | 2.0mm+ |

Check wall thickness visually in slicer:

For precise measurement, use CAD software:

Got: All walls meet minimum thickness for chosen process. Thin walls flagged for review.

If fail: Return to CAD and thicken walls, or:

4. Determine Print Orientation

Select orientation to optimize strength, surface finish, and support usage:

Orientation decision matrix:

For strength:

For surface finish:

For minimal supports:

Load direction analysis:

If part experiences:
- Tensile load along axis → print with layers perpendicular to axis
- Compressive load → layers can be parallel (less critical)
- Bending moment → layers perpendicular to neutral axis
- Shear → avoid layer interfaces parallel to shear direction

Got: Orientation chosen with explicit rationale for strength, finish, or support tradeoffs.

If fail: If no orientation satisfies all requirements, prioritize in order: functional strength → dimensional accuracy → surface finish → support minimization.

5. Generate Support Structures

Configure automatic or manual supports for overhangs:

Support angle thresholds:

Support types:

Tree supports (FDM, recommended):

Linear supports (FDM, traditional):

Heavy supports (SLA):

Interface layers:

In slicer (PrusaSlicer example):

Print Settings → Support material

Got: Supports generated for all overhangs exceeding threshold angle, preview shows no floating geometry.

If fail: If automatic supports inadequate:

6. Configure Slicer Profile

Set process-appropriate parameters:

FDM layer heights:

SLA layer heights:

Key parameters by process:

FDM:

layer_height: 0.2mm
line_width: 0.4mm (= nozzle diameter)
perimeters: 3-4 (structural), 2 (cosmetic)
top_bottom_layers: 5 (0.2mm layers = 1mm solid)
infill_percentage: 20% (cosmetic), 40-60% (functional)
infill_pattern: gyroid (FDM), grid (basic)
print_speed: 50mm/s perimeter, 80mm/s infill
temperature: material-specific (see select-print-material skill)

SLA:

layer_height: 0.05mm
bottom_layers: 6-8 (strong bed adhesion)
exposure_time: material-specific (2-8s per layer)
bottom_exposure_time: 30-60s
lift_speed: 60-80mm/min
retract_speed: 150-180mm/min

Got: Profile configured with process-appropriate defaults, modified for specific material/model requirements.

If fail: If unsure about parameters, start with slicer's default "Standard Quality" profile for chosen material, then iterate.

7. Preview Slice Layer-by-Layer

Inspect sliced G-code for issues:

In slicer:

Red flags in preview:

Got: Preview shows continuous perimeters, proper infill, clean travels, and no obvious defects.

If fail: Adjust slicer settings and re-slice. Common fixes:

8. Export G-code and Verify

Save sliced G-code with descriptive name:

# Naming convention:
# <part_name>_<material>_<layer_height>_<profile>.gcode
# Example: bracket_petg_0.2mm_standard.gcode

# Verify G-code:
grep "^;PRINT_TIME:" model.gcode  # Check estimated time
grep "^;Filament used:" model.gcode  # Check material usage
head -n 50 model.gcode | grep "^M104\|^M140"  # Verify temperatures

# Expected first layer temp:
# M140 S85  (bed temp for PETG)
# M104 S245 (hotend temp for PETG)

Pre-print checklist:

Got: G-code file saved with embedded metadata, temperatures verified, print time/material estimate reasonable.

If fail: If print time excessive (>12 hours), consider:

Validation Checklist

Pitfalls

  1. Skipping mesh repair: Non-manifold meshes can slice but fail to print correctly with gaps or malformed layers
  2. Ignoring wall thickness: Thin walls (< minimum) will have gaps, drastically reducing strength
  3. Wrong orientation for strength: Printing tensile parts with layers parallel to load direction creates weak delamination plane
  4. Insufficient supports: Underestimating overhang angle leads to sagging, stringing, or complete failure
  5. First layer neglect: 90% of print failures occur in first layer—Z-offset and bed adhesion are critical
  6. Temperature from Internet: Every printer/material combination is unique; always calibrate temperature with tower tests
  7. Excessive detail for layer height: Fine features smaller than 2× layer height won't resolve properly
  8. Not previewing slice: Slicers can make unexpected decisions (thin wall gaps, weird infill); always preview before printing
  9. Material hygroscopy: Wet filament (especially Nylon, TPU, PETG) causes poor layer adhesion, stringing, and brittleness
  10. Overconfidence in supports: Heavy parts with large overhangs can still sag even with supports—test on smaller models first

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.