STEP to STL Conversion Methods

For a related note with information on optimisation steps, please see STEP to STL: Optimising Mesh Sub-Division

PDF3D ReportGen and PDF3D.IO development SDK can be used to convert STEP to 3D PDF. In addition, STEP files may also be exported in STL format.

Within PDF3D ReportGen, this may be controlled in the ‘Conversion’ tab.

image

Using PDF3D.IO development SDK as a batch command-line or dll service can also be utilised perform this operation.

Firstly, establish both input and output files and output file type, using:

<?xml version="1.0" encoding="iso-8859-1"?>
<InputParameters>
    <Assembly>
        <InputFileName value="Reference.stp"/>
    </Assembly>
    <OutputFileName value="Reference.stl"/>
    <OutputFormat value="STL"/>
    <STLOptions binary="true"/>
	...
</InputParameters>

Often STEP models have BREP Solids defined. These are tessellated into triangles during conversion. A further tag can be introduced to control the resolution, using:

<DefaultAssemblyProperties>
        <OcParameters exportLines="false" numberOfSegments="100" 
                      exportPoints="false" linearDeflection="0.001"/>
    </DefaultAssemblyProperties>

Use the “linearDeflection” angle parameter, the lower the value (above zero), the more triangles are produced.

If further optimization is needed to reduce the STL size, then full mesh simplification can be enabled, by using:

    <Simplification 
        enabled="true" 
        onlySubsetPlacement="true" 
        boundaryWeight="1000" 
        thresoldPointsCount="150000" 
        rgbWeight="0.01"
        pointWeight="1e-05"
        thresoldTrianglesCount="150000"
        uvWeight="0.01"
        thresoldLineSegmentsCount="15000000"/>

The above example enables simplification and reduces the output STL to contain approximately 150k triangles.