File Exchange

image thumbnail

Model3d

version 1.0 (321 KB) by

MATLAB class for reading, viewing 3D dxf and 3ds files.

3.0625
16 Ratings

24 Downloads

Updated

View License

This is a MATLAB class that allows the user to read in Autocad (.dxf) and 3D Studio Max (.3ds) files.

The class can be plotted and functions are included for simple model manipulation (translation, rotation, magnification, superposition)

Comments and Ratings (31)

The function model3d is empty

Imran Anees

The model3d function is not present in this code.

Paul

Paul (view profile)

Alireza

Alireza (view profile)

Alireza

Alireza (view profile)

Guys, find newer version here: https://code.google.com/p/matlabmodel3d/

Nick

Nick (view profile)

carlos

carlos (view profile)

Mohamed

I'm working on MATLAB 2013a 64-bit on windows and I cannot get to use the library, I tried to recompile but I get all sorts of error. I fianlly managed to mex the code but loading the library doesn't work.
The error I get is like this
Type 'intclassModel3D{public:' was not found. Defaulting to type error.

ANy help?

John

John (view profile)

I downloaded the Model3d matlab functions, but had trouble getting it to work. It seems as if the model3d.m file is all comments without any coding in its contents.

I understand this may be a bad question, but I do not have much programming experience, so I was wondering if anyone could help me with a step my step procedure of what needs to be done to get this program working.

Bruno

Bruno (view profile)

in Matlab r2011b I try to excecute the command but I receive this error:
"Error using class
The CLASS function must be called from a class constructor." I guess I have to recompile it... Isn't it? How can I do it? Thank you very much!

Jonas

Jonas (view profile)

Grant Lohsen

I can't get this to run on windows. I get the error "??? Undefined function or method 'model3d' for input arguments of type 'char'". I noticed that this includes .mexglx files, and i believe this is linux files. Does anyone have the mexw64 files so I can run this? alternatively, is there a free compiler I can put on my system to compile this?

Matlab R2008b

"Also, "int dims[3];" should be changed to "mwSize dims[3];" to make it compile."

- In the mexfunction.cpp, row 211, that is

Here is what I changed in the makefile to get the compilation working on Linux64; The first rows in the makefile now looks as follows:
TARGET = ../model3d.mexa64
TARGET2 = ../serialize.mexa64
SOURCES = dxf.cpp mexfunction.cpp model3d.cpp c3ds.cpp
MATDIR = /opt/matlab
#CXX = icpc
#CXXFLAGS = -gcc-version=320 -cxxlib-gcc=/usr/local/gcc-3.2.3 -O3 -xN -w1
#CXX = /usr/local/gcc-3.2.3/bin/g++
CXX = g++
CXXFLAGS = -O3 -Wall -fPIC
LIBDIR = -L$(MATDIR)/bin/glnxa64

Note that you probably should adjust the matlab path.

Also, "int dims[3];" should be changed to "mwSize dims[3];" to make it compile.

Best Regards,
Jonatan Olofsson

Markus

Markus (view profile)

It is working nicely. But I have problems to run the rotation by using qrot(m,pi/2,pi/2). Or even if I load the qrot3d function from the file exchange it didn't work out. Does anybody have experience with this functions or can give me a hint how to use. Thanks a lot.

John D'Errico

John D'Errico (view profile)

greg is wrong here. The old style OOP methods still work nicely in current matlab releases.

Greg

Greg (view profile)

This code uses old-style (pre-2008a, I believe) object-oriented programming. As far as I can tell, that makes it pretty much non-functional in any newer version of Matlab.

Hi

Thanks for the great model3d script .

However, it behaves strangely for certain 3ds files.

For example, the following maxda3 3ds model purchased from,

http://www.the3dstudio.com/product_details.aspx?id_product=14495

was rendered as shown in

http://srimal-techdiary.blogspot.com/2010/03/misaligned-3ds-model-rendered-with.html

(Note: the wheels and fenders are in the wrong place)

It renders correctly in 3D MAX.

Am I missing something?

Thanks in advance

Srimal.

Upgraded to 2008b and it stopped working. Couldn't fix it myself. Please update and I will change my rating.

Nikhil K

Very nice. Worked right away with just two lines of code and a 3DS model. Is there existing/planned support for animation, i.e. frames?

Bhavik

Bhavik (view profile)

I am beginner in MATLAB please tell me how to run this file..

Jon Beich

Model.m file is only remarks... can't use anything else without the model

Gayathri

The code produced a model3d object, but was not able to plot it as it gave an error saying that the alpha value must be within 0 and 1.
A sample 3ds file that worked for the author could have been better to evaluate the functioning of this code.
A better readme would have been nice.

Paul Foxgrover

Very helpful. Works Great!
Thanks!

Scott B.

Sorry but for me this code was unreliable for dxf files produced by any version of autocad. I like the fancy class wrapper but you might want to reconsider your claims for dxf files. I'll revisit this and upgrade my review if you can sort out the dxf problems.

Lijun Yan

  thank you for your share, but there is nothing in model3d.m

Nory chemii

My friend introduced me to MATLAB when i search software for make 3D graphics with 3 values of X, Y and Z. I hope i can use MATLAB

Justin Barnes

Worked great for me on 3ds but had dxf trouble

olivier PROT

Very Nice ! Have some problems with .3ds files but it works well with .dxf.

Christian none

Sorry, the last entry was a mistake. But this one is what I meant!

MATLAB Release
MATLAB 7.0.4 (R14SP2)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

model3d/@model3d/