Code covered by the BSD License  

Highlights from
STL to ACIS SAT conversion

4.0

4.0 | 3 ratings Rate this file 28 Downloads (last 30 days) File Size: 77.25 KB File ID: #27174
image thumbnail

STL to ACIS SAT conversion

by Adam A

 

06 Apr 2010 (Updated 22 Aug 2011)

Convert an STL file into ACIS SAT, which can be more readily imported into various CAD packages.

| Watch this File

File Information
Description

STL to ACIS SAT converter
=========================

Adam H. Aitkenhead
31st March 2010

Convert an STL file into an ACIS v4.0 SAT file (Standard ACIS Text), which can be more readily imported into various CAD packages (including Solidworks) as a solid model.
 
 
USAGE:
======
>> CONVERT_stl_to_sat(STLfilename)
or
>> CONVERT_stl_to_sat(STLfilename,STLformat)

converts the stl file <STLfilename> into an ACIS SAT file. The optional string <STLformat> defines the format of the STL file as one the following:
   'auto' - (The default option) Automatic detection of the file format
   'ascii' - ASCII format
   'binary' - Binary format
 
 
EXAMPLE:
========
>> CONVERT_stl_to_sat('sample.stl')
 
converts the STL file 'sample.stl' into an ASIC SAT file called 'sample.sat'.
 
 
STL REQUIREMENTS:
=================
The STL data must meet the following criteria:

1. All facets are triangular.
2. No duplicate or overlapping facets exist.
3. The mesh is properly closed.
4. The facet normals are properly defined.
5. For each facet edge, there exists an odd number of identical edges on adjacent facets.

Although uncommon, some STL meshes may not meet requirement 5 and cannot be converted to SAT using this code.
 
 
OTHER NOTES
===========
For a description of the ACIS format, refer to: http://local.wasp.uwa.edu.au/~pbourke/dataformats/sat/sat.pdf

Depending on the hardware, conversion is performed reasonably quickly for STL meshes of up to a few thousand facets. For larger meshes the conversion time increases roughly with the square of the number of facets.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
22 Jul 2011 Kevin Moerman

Imports fine into Pro/ENGINEER and also CUBIT. Thanks!

22 Jul 2011 Kevin Moerman

Is it possible to group faces that have similar orientations?

01 Aug 2011 Adam A

Hi Kevin, glad you find the code useful. Regarding grouping faces into similar orientations - this might be possible, but I no longer have access to CAD software which reads ACIS files so I'm no longer able to develop/test the code.

04 Aug 2011 Curtis

This is very useful.
However, if the .stl file to be converted was created from a mesh of geometry which had to be cut up (in CUBIT) before it could be meshed, it throws an error because it doesn't see that the mesh is watertight. Do you have any suggestions on how I might work around this?

05 Aug 2011 Adam A

Hi Curtis,
If you're able to email me a sample stl that shows the problem I'll see if I can find a way around it. (You can contact me via the 'contact author' link on my profile page.)

02 Jun 2012 TCH

The running procedure would always violate the fifth criterion (say "the stl file does not meet requirement 5: For each facet edge, there exists an odd number of identical edges on adjacent facets.") inadequate further information is available and prompted for further improvement of my stl file. The stl file I am using is generated from the stlwrite function authored by Grant Lohsen (see the link:http://www.mathworks.com/matlabcentral/fileexchange/36770-stlwrite-write-binary-or-ascii-stl-file)
I have used this file for a long time. Is there anything I could do to save this situation? I am indeed need the acis file format.

Please login to add a comment or rating.
Updates
07 Apr 2010

7th April 2010: Optimisation of the WRITE_sat.m code. Conversion now runs 10-15% quicker for large meshes.

07 Apr 2010

Added H1 headers.

29 Apr 2010

Added automatic removal of zero-area facets.

07 May 2010

Optimised the WRITE_sat.m code, giving a speed increase of 30-40% for larger meshes.

17 May 2010

Another 20-25% speed improvement.

25 May 2010

Minor bug fix.

22 Aug 2011

Added extra checks to test if the input mesh meets requirement 5. Also, small speed improvement for import of binary STL files.

Tag Activity for this File
Tag Applied By Date/Time
cad Adam A 06 Apr 2010 10:24:02
stl Adam A 06 Apr 2010 10:24:02
acis Adam A 06 Apr 2010 10:24:02
data import Adam A 06 Apr 2010 10:24:02
convert Adam A 06 Apr 2010 10:24:02
sat Adam A 06 Apr 2010 10:24:02
data export Adam A 07 Apr 2010 10:06:01

Contact us at files@mathworks.com