4.63636

4.6 | 22 ratings Rate this file 121 downloads (last 30 days) File Size: 120.97 KB File ID: #3642

CAD2MATDEMO.M

by Don Riley

 

23 Jun 2003 (Updated 25 Jun 2003)

No BSD License  

3D CAD data to MATLAB Converter, CAD STL to MATLAB Patch.

Download Now | Watch this File

File Information
Description

CAD2MATDEMO is a demonstration of importing 3D CAD data into MATLAB.

The demo includes:

1) the general program,
2) 4 CAD data file samples, and
3) a simple script that executes the program to show the 4 samples.

To get CAD data into MATLAB, the process is:

1) Export the 3D CAD data as an ASCII STL (or Pro/E render SLP) file.
2) This MATLAB routine reads the CAD data, and
3) Once read, the CAD data is rotated around a bit for viewing.

The program has been tested with: AutoCAD, Cadkey, and Pro/Engineer.
It should work with most any CAD programs that can export STL files.

Format Details: STL is supported, and the color version of STL that Pro/E exports, called 'render' is also supported. The render (SLP) is just like STL but includes color.

Only that data associated with STL or SLP files are translated, e.g., geometry and the geometry color. No textures, transparencies, or other such things are exported with the STL (or SLP) file.

Note: This routine has both the import function and some basic manipulation for testing. The actual reading mechanism is located at the end of the demo file.

Acknowledgements
This submission has inspired the following:
3D Puma Robot Demo, XMas Tree
MATLAB release MATLAB 6.5 (R13)
Zip File Content  
Other Files showmethedemos.m,
cap.slp,
hook.stl,
link1.stl,
cad2matdemo.m,
sprocket.slp
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (24)
20 Oct 2003 Duane Nightingale

Very nice utility that seems to be working for us right out of the box. Thanks for sharing.

12 Feb 2004 Rajeev Jain  
10 Nov 2004 Fadi Glor

works great - do you have anything for performing boolean operations on stl-files? Like merging two stl-files into one? Looking for the intersection of two stl-files?

19 Dec 2004 Chris Barnhart

Works great!

17 Feb 2005 Tom Mansfield

This has helped me so munch. Thanks.

16 Mar 2006 abelmi ab

I had tried it.It's work good.Nice job

30 Mar 2006 S G

Very nicely done

06 May 2006 H O  
11 Jul 2006 N Q

Works first time. Very useful, but slow for big models.

26 Aug 2006 SIVA PRASAD

I WANT A MATLAB CODE FOR STL OFFSETTING(VERTEX OFFSETTING)
IN MY PROJECT I NEED TO GENERATE A 3D OBJECT WITH GIVEN OFFSET..SO PLEASE UPDATE THIS..

13 Dec 2006 Sebastian Held

great demo; easy to use. Thanks.

15 Jan 2007 Ha Seungwon

it's very good.

23 Jan 2007 Matt Donath

Good demo for small models. However, it took 20 minutes to load a model of a transport vehicle.

27 Jan 2007 abelmi ab

Look great

05 Jun 2007 Roland Lehmann

Great program that saved me a lot of time. Thank you for sharing!

09 Oct 2007 Raphael Beckers

Exactly what I was searching for. A little bit slow, yes, but I have no Idea how to make it faster.

12 Oct 2007 M Genest

Great tool

I strongly recommend you modify the file opening function to pre-allocate the memmory. This allow to open large model a lot faster.

This can easily be done

09 Mar 2008 Scott Burnside

After adding some preallocation I found this code to be very simple, straightforward and robust. This example is particularly useful to me as I am writing a 3D track display and was able to write a process based on your example so that we could develop our track symbols in autocad and bring the vertices and faces into Matlab as a patch object. An amazing combination of tools. Thank you for sharing.

27 Mar 2008 igor scardanzan

what one needs to start exporting matlab patch in CDF pre processing tools
just slow in writing the STL file

24 Jul 2008 Sharina S

Great work indeed.This helped me in my project.

22 Aug 2008 Greg C

Any suggestions on the memory pre-allocation? I made several attempts unsuccesfully.

12 Mar 2009 Husam Aldahiyat  
04 Apr 2009 Alex Frid

Hi,
i have tried to load a different 6DOF arm in to the code and bumped on problem of the initial location. How do you set what the initial location of each part before you performing the InitHome function call.

22 Jun 2009 badr Higab  
Please login to add a comment or rating.
Updates
25 Jun 2003

I have just updated the file (R2), due to a capitalization issue on some internal functions that kept the rotations from working. The demo should be working correctly now.

Tag Activity for this File
Tag Applied By Date/Time
data import Don Riley 22 Oct 2008 07:03:29
data export Don Riley 22 Oct 2008 07:03:29
3d cad Don Riley 22 Oct 2008 07:03:29
translation Don Riley 22 Oct 2008 07:03:29
autocad Don Riley 22 Oct 2008 07:03:29
dxf Don Riley 22 Oct 2008 07:03:29
proe Don Riley 22 Oct 2008 07:03:29
stl Don Riley 22 Oct 2008 07:03:29
data import Ethan 12 Mar 2009 02:07:59
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com