Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Creating a 3D object using faces and vertices.

Please login with a confirmed email address before reporting spam

Hi all,

I am trying to create a 3D object using COMSOL script.
My object has a complex and arbitrary geomtry.
The geometry is defined using two matrices: faces and vect.
I can display the object using MATLAB but still ave difficulties in creating the object in COMSOL.
I pasted my script below (This script is based on the discussion between Chan and Pasquale).
------------------------------------------------------
nface=size(faces,1);
fObj=cell(1,nface);

for I=1:nface
f=faces(I,:);
localVertex=vert(f,:);
X=[localVertex(1,1),localVertex(2,1); localVertex(4,1),localVertex(3,1)];
Y=[localVertex(1,2),localVertex(2,2); localVertex(4,2),localVertex(3,2)];
Z=[localVertex(1,3),localVertex(2,3); localVertex(4,3),localVertex(3,3)];
fObj{I}=face3(X,Y,Z);
end

solidObj=geomcoerce('solid',fObj);
------------------------------------------------------
If I run the script, I have a following error:
------------------------------------------------------
??? Java exception occurred:
Exception: com.femlab.jni.FlNativeException: Internal error geometry decomposition
Messages: Internal error geometry decomposition
Stack trace:
at csgsurfisect.cpp, row 543, ()
at com.femlab.geom.Geom.coerce(Native Method)
at com.femlab.geom.Geom.b(Unknown Source)
at com.femlab.geom.Geom.coerce(Unknown Source)
Error in ==> geomcoerce at 54
jptr = com.femlab.geom.Geom.coerce(jgeoms, sdim, totype, prop, outprop);
Error in ==> seg_salt_data_process10 at 43
solidObj=geomcoerce('solid',fObj);
------------------------------------------------------
Could you suggest any possible solution for this problem or a btter way to generate a 3D object defined by faces and vertices in COMSOL? Attached is my sample faces and vertice matrices.

In advance, I appreciate your help.

Evan


3 Replies Last Post 2010年2月23日 GMT-5 04:01
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年11月1日 GMT-5 03:22
Hi

have you tried to play with the order or the points/vertices?

Comsol has a given way to count the vertices, you might have an inverted surface.

I have had some difficulties with this before, unfortunately I have not found any simple clear explanation/examples how to get this vertex oder "correct". And I gave up using Comsol geoemetries some years ago, it's much quicker with the CAD link to SolidWorks (BUT I admit COMSOL written geoemtries are nice for simple cases and are more powerfull, as well as these excercices allows you to read in and translate ANSYS or NASTRAN data files which is lacking in COMSOL today, you can only read in the meshes from NASTRAN but not get in the the minimum of material data, groups or shell/beam properties)

Now it might be another error you are hitting, so do not only search in the direction given above.

Good luck
Ivar
Hi have you tried to play with the order or the points/vertices? Comsol has a given way to count the vertices, you might have an inverted surface. I have had some difficulties with this before, unfortunately I have not found any simple clear explanation/examples how to get this vertex oder "correct". And I gave up using Comsol geoemetries some years ago, it's much quicker with the CAD link to SolidWorks (BUT I admit COMSOL written geoemtries are nice for simple cases and are more powerfull, as well as these excercices allows you to read in and translate ANSYS or NASTRAN data files which is lacking in COMSOL today, you can only read in the meshes from NASTRAN but not get in the the minimum of material data, groups or shell/beam properties) Now it might be another error you are hitting, so do not only search in the direction given above. Good luck Ivar

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年11月1日 GMT-5 03:22
Hi

have you tried to play with the order or the points/vertices?

Comsol has a given way to count the vertices, you might have an inverted surface.

I have had some difficulties with this before, unfortunately I have not found any simple clear explanation/examples how to get this vertex oder "correct". And I gave up using Comsol geoemetries some years ago, it's much quicker with the CAD link to SolidWorks (BUT I admit COMSOL written geoemtries are nice for simple cases and are more powerfull, as well as these excercices allows you to read in and translate ANSYS or NASTRAN data files which is lacking in COMSOL today, you can only read in the meshes from NASTRAN but not get in the the minimum of material data, groups or shell/beam properties)

Now it might be another error you are hitting, so do not only search in the direction given above.

Good luck
Ivar
Hi have you tried to play with the order or the points/vertices? Comsol has a given way to count the vertices, you might have an inverted surface. I have had some difficulties with this before, unfortunately I have not found any simple clear explanation/examples how to get this vertex oder "correct". And I gave up using Comsol geoemetries some years ago, it's much quicker with the CAD link to SolidWorks (BUT I admit COMSOL written geoemtries are nice for simple cases and are more powerfull, as well as these excercices allows you to read in and translate ANSYS or NASTRAN data files which is lacking in COMSOL today, you can only read in the meshes from NASTRAN but not get in the the minimum of material data, groups or shell/beam properties) Now it might be another error you are hitting, so do not only search in the direction given above. Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年2月23日 GMT-5 04:01
Hello

Did you find a solution for your problem ?
I didn't understand why you have 4 dimensions ....

nface=size(faces,1);
fObj=cell(1,nface);
for I=1:nface
f=faces(I,:);
localVertex=pts(f,:);
X=[localVertex(1,1),localVertex(2,1),localVertex(3,1)];
Y=[localVertex(1,2),localVertex(2,2),localVertex(3,2)];
Z=[localVertex(1,3),localVertex(2,3),localVertex(3,3)];
fObj{I}=face3(X,Y,Z);
end


Error: Internal geometry error.
Error in built-in function javaObject.
bsplinesurf3 80 jptr=com.femlab.geom.BSplineSurf3(prop);
face3 75 obj = bsplinesurf3(p,q,u,v,x,y,z,varargin{4:end});

do you know where can it come from ?
thanks

Hello Did you find a solution for your problem ? I didn't understand why you have 4 dimensions .... nface=size(faces,1); fObj=cell(1,nface); for I=1:nface f=faces(I,:); localVertex=pts(f,:); X=[localVertex(1,1),localVertex(2,1),localVertex(3,1)]; Y=[localVertex(1,2),localVertex(2,2),localVertex(3,2)]; Z=[localVertex(1,3),localVertex(2,3),localVertex(3,3)]; fObj{I}=face3(X,Y,Z); end Error: Internal geometry error. Error in built-in function javaObject. bsplinesurf3 80 jptr=com.femlab.geom.BSplineSurf3(prop); face3 75 obj = bsplinesurf3(p,q,u,v,x,y,z,varargin{4:end}); do you know where can it come from ? thanks

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.