Mon, 04/20/2009 - 18:36
Hi guys,
I need to handle some elliptical toroidal surfaces which I create as surface of revolution of an ellipse. The construction works fine, but I am not able to perform a Boolean 'common'-operation between the torus and a usual box.
So I decided to perform the operation in DRAWEXE to check if it works in principle. Well, it doesn't. This is an example:
----------------------------------------
Draw[3]> ellipse ELL 10 0 0 0 1 0 5 3
Draw[4]> revsurf SOR ELL 0 0 0 0 0 1
Draw[5]> box B 0 0 -250 500 500 500
Draw[6]> bcommon RESULT SOR B
Null shapes are not allowed
----------------------------------------
The SurfaceOfRevolution (SOR) is build, the box should be okay, too. But why does bcommon claim that there's a Null shape?
Has anyone any idea?
Thanks in advance,
Dennis
Tue, 04/21/2009 - 09:58
ELL is a curve and SOR is a surface. You need to create a shape from SOR before a boolean operation. I haven't played with surfaces much, but you may want to check in DRAWEXE the functions mkface, mksol and such.
Tue, 04/21/2009 - 12:27
Hi Paul,
thank you for the hint. Actually, inside the program I first make a half-space and generate a TopoDS_Solid from it, but forgot to do so while using DRAWEXE.
Back to the DRAWEXE example.
---------------------------------------
Draw[3]> ellipse E 10 0 0 0 1 0 5 3 // make ellipse (curve)
Draw[4]> revsurf Ssurf E 0 0 0 0 0 1 // make surface of revolution from ellipse (surface)
Draw[5]> mkface Tface Ssurf // make a face from surface
Draw[6]> mksol T Tface // make torus solid from face
Draw[7]> box B 0 0 -250 500 500 500 // make box
Draw[8]> bcommon Res B T // perform boolean COMMON operation
not done ErrorStatus()=101
--------------------------------------
Now I use two solids to compute their common volume. This works if I do the 'bcommon' operation with a sphere instead of the elliptical torus (the sphere is constructed in the same way the torus 'T' is) and the box 'B'. So I assume the OCC code cannot handle the 'common' operation on surfaces of revolution (at least not for this special case).
I just found out, that I get a "segmentation violation" when I decrease the size of the box.
--------------------------------------
Draw[67]> box B 0 0 -12 15 15 12
Draw[68]> bcommon Res T B
An exception was caught 0xb6ab6bd1 : OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 4012d980
** Exception ** 0xb6ab6bd1 : OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 4012d980
---------------------------------------
I guess, I have to find another way to find the common volume of the torus and any other solid.
Regards,
Dennis
Tue, 04/21/2009 - 17:19
Are you sure the torus you get is what you really intended? I find the shape to be quite "strange".
Tue, 04/21/2009 - 17:43
Yes, unfortunately I need to use elliptic tori. I need to handle a model of the ITER tokamak fusion device which is build with these kind of surfaces.
What's "strange" about the shape?
http://mathworld.wolfram.com/EllipticTorus.html
Wed, 04/22/2009 - 09:41
The one I got in DRAWEXE didn't look like that the first time I tried. That's why I said it looked "strange". Now I repeated the process and it looks like it should.
I used bop and bopcommon instead, and I got the box cut by the torus. I expected another result from the common operation, but that's what I got. bcommon gave me the same result also.
Wed, 04/22/2009 - 11:42
You don't get an error message? =0
That's just great. Why always me? Okay, thanks for your help, Paul.
I'll experiment a little more and hope that I'll find a solution.
Best Regards,
Dennis