File Formats
Import formats
STEP (.step, .stp)
| Aspect | Details |
|---|---|
| Standard | ISO 10303 (STEP AP214 / AP242) |
| Parser | Client-side (parsed in the browser) |
| Use cases | Design domain geometry, preserve regions, fixed faces, obstacle volumes |
| Features preserved | Solid geometry, B-Rep face structure, edge topology |
| Coordinate system | Converted to Z-up on import |
STEP is the recommended format for importing CAD geometry. It preserves the B-Rep face structure, which allows you to select individual faces for fixed boundary conditions. The file is parsed entirely in the browser -- no server round-trip is needed for geometry processing.
Supported geometry types:
- Solid bodies (single and multi-body)
- Shell/surface bodies
- Wire bodies (edges only, limited support)
Limitations:
- Assembly structure is flattened to a single compound shape.
- Parametric feature history is not preserved.
- Colors and material assignments from the CAD system are not imported.
STL (.stl)
| Aspect | Details |
|---|---|
| Standard | Stereolithography / Standard Tessellation Language |
| Parser | Client-side (parsed in the browser) |
| Use cases | Design domain geometry, obstacle volumes, preserve regions |
| Variants | ASCII and binary STL both supported |
STL files contain triangulated surface meshes. They are widely supported but lack B-Rep face information, so you cannot select individual faces for boundary conditions. Use STEP when face selection is needed.
Limitations:
- No face structure (the entire mesh is one surface).
- No color or material information.
- Large triangle counts increase rendering time. Decimate before importing if the mesh exceeds 500,000 triangles.
Export formats
STL (.stl)
The solver exports the optimized design as a binary STL file. The mesh is generated by extracting the material boundary surface at the 0.5 threshold from the result field.
| Aspect | Details |
|---|---|
| Generator | Marching cubes (2D: contour extraction, 3D: marching cubes) |
| Material threshold | 0.5 (cells with material value above 0.5 are solid) |
| Coordinate system | Z-up, positioned in world space using design domain offset |
| Units | Millimeters |
The exported STL is ready for 3D printing or import into downstream CAD tools. It includes the design domain offset so the part is positioned correctly relative to preserves and bolt pads.
Material layout (binary)
The raw material layout can be downloaded as a binary file for external processing or solver continuation.
| Aspect | Details |
|---|---|
| Format | Raw float32 binary array |
| Layout | Row-major, nely x nelx (2D) or nelz x nely x nelx (3D) |
| Values | 0.0 (void) to 1.0 (solid) |
| Use case | Solver continuation (fork from a previous run), external visualization, post-processing |
Convergence data (JSON)
Convergence history is available as JSON, containing per-iteration values for objective, K_p, volume fraction, and design variable change.
Displacement animation data
The final-iteration displacement field is available for animation playback. It includes nodal displacements and mesh node coordinates.
File size limits and recommendations
| Format | Recommended max size | Hard limit | Notes |
|---|---|---|---|
| STEP import | 50 MB | 100 MB | Large assemblies should be simplified before import. |
| STL import | 25 MB | 50 MB | Decimate to < 500K triangles for smooth rendering. |
| STL export | -- | -- | Size depends on grid resolution. A 200x100 grid produces ~1--5 MB. |
| Material layout | -- | -- | Size is nelx x nely x 4 bytes (float32). A 200x100 grid is ~80 KB. |
Recommendations
- Prefer STEP over STL when you need face selection for boundary conditions or when geometric precision matters.
- Simplify geometry before import. Remove fillets, chamfers, and small features that will not affect the optimization but increase mesh complexity.
- Check orientation after import. deFlex uses a Z-up coordinate system. STEP files from Y-up CAD systems are automatically reoriented, but verify the result.
- Use the placement controls (position, rotation, offset, scale) in the part properties panel to align imported geometry with your design domain.