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.

3D geometry object

Please login with a confirmed email address before reporting spam

Dear Comsol-Community members,

i try to create a 3D geometry object by my data-points (given in
3D-coordinates). The way i want to realize it is explained in the following
example:

I want to create a cube. All what i know are the coordinates of the corners.
These data-points are for example given by

(0,0,0),(1,0,0),(1,0,1),(0,0,1),
(1,1,0),(1,1,1),(0,1,1),(0,1,0)

First i create the lines (edges) of the cube

g1=curve3([0,1],[0,0],[0,0]);
g2=curve3([1,1],[0,0],[0,1]);
g3=curve3([1,0],[0,0],[1,1]);
g4=curve3([0,0],[0,0],[1,0]);

g5=curve3([0,0],[0,1],[0,0]);
g6=curve3([1,1],[0,1],[0,0]);
g7=curve3([1,1],[0,1],[1,1]);
g8=curve3([0,0],[0,1],[1,1]);

g9=curve3([0,1],[1,1],[0,0]);
g10=curve3([1,1],[1,1],[0,1]);
g11=curve3([1,0],[1,1],[1,1]);
g12=curve3([0,0],[1,1],[1,0]);

clear c
c.objs={g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12};
c.name={'B1','B2','B3','B4','B5','B6','B7','B8','B9','B10','B11','B12'};
c.tags={'g1','g2','g3','g4','g5','g6','g7','g8','g9','g10','g11','g12'};

But how can i now create a 3D object by these lines? I think that now i have to
define the faces of the cube and then i can convert it into a 3D object, right?
I want to have a 3D Object consisting of the boundary (= the faces of the cube)
and the interior. I hope that somebody can help me.

Thank you.

2 Replies Last Post Nov 6, 2009, 12:12 p.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 6, 2009, 5:41 a.m. EST
Hello,

transform your coordinates in axis base points and lengths and use the block3-command.
For instance

% Geometry
g1=block3('1','1','1','base','corner','pos',{'0','0','0'},'axis',{'0','0','1'},'rot','0');

% Geometry objects
clear s
s.objs={g1};
s.name={'BLK1'};
s.tags={'g1'};
fem.draw=struct('s',s);

Regards,
Roland Martin
Hello, transform your coordinates in axis base points and lengths and use the block3-command. For instance % Geometry g1=block3('1','1','1','base','corner','pos',{'0','0','0'},'axis',{'0','0','1'},'rot','0'); % Geometry objects clear s s.objs={g1}; s.name={'BLK1'}; s.tags={'g1'}; fem.draw=struct('s',s); Regards, Roland Martin

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 6, 2009, 12:12 p.m. EST
Hello,

thank you, that's fine. But the block3-command creates only rectangular geometries. But I want to know, how i can create polygonal 3D-domains (from data points), for example: I have the points (now we have 1 point more)

(0,0,0),(1,0,0),(1,0,1),(0,0,1),
(1,1,0),(1,1,1),(0,1,1),(0,1,0),
(0.1,0.5,2),(0.5,0.5,2)

The points (0.1,0.5,2) and (0.5,0.5,2) should be connected. Moreover the point (0.1,0.5,2) should also be connected with (0,0,1) and (0,1,1). And the point (0.5,0.5,2) should be connected with (1,0,1) and (1,1,1).

How i can create a geometry like this?

I hope that somebody can give me a answer.

Thank you.
Hello, thank you, that's fine. But the block3-command creates only rectangular geometries. But I want to know, how i can create polygonal 3D-domains (from data points), for example: I have the points (now we have 1 point more) (0,0,0),(1,0,0),(1,0,1),(0,0,1), (1,1,0),(1,1,1),(0,1,1),(0,1,0), (0.1,0.5,2),(0.5,0.5,2) The points (0.1,0.5,2) and (0.5,0.5,2) should be connected. Moreover the point (0.1,0.5,2) should also be connected with (0,0,1) and (0,1,1). And the point (0.5,0.5,2) should be connected with (1,0,1) and (1,1,1). How i can create a geometry like this? I hope that somebody can give me a answer. Thank you.

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.