Hi Sevgi,
To address the issue of a two-piece geometry collapsing into one when imported from an STL file into MATLAB, here are streamlined steps for resolution:
1. STL File Structure
- Separate Bodies: Verify the STL contains two distinct bodies. Some CAD software can save multiple bodies in one STL, which must be defined separately.
- Export Settings: Check CAD software export settings to ensure bodies are exported as separate files or maintain assembly structure.
2. Importing into MATLAB
- Use MATLAB’s "importGeometry" function with the correct syntax to ensure the geometry maintains its structure upon import, adjusting for binary or ASCII STL files as needed.
3. Inspect Geometry in MATLAB
- View Geometry: Utilize "pdegplot" or similar commands to visually confirm the geometry is imported as separate pieces.
- Adjust if Needed: If MATLAB imports it as a single piece, manually define or adjust boundaries within MATLAB to separate the geometry.
4. Model Adjustment
- Manual Separation: Manually adjust the model or script in MATLAB to define separate regions if automatic recognition fails.
- Meshing Strategy: Re-meshing within MATLAB can offer better control and definition of parts.
You may refer to the following documentation links to have a better understanding on importing 3-D geometry from STL:
- https://www.mathworks.com/help/pde/ug/pde.pdemodel.importgeometry.html#bupbfb3
- https://www.mathworks.com/help/pde/ug/stl-file-import.html