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.
Posted 31.10.2009, 17:24 GMT-4 3 Replies
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
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
Attachments:
3 Replies Last Post 23.02.2010, 04:01 GMT-5