Export Torus

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
RomainM

Export Torus

Post by RomainM »

Hi,

I would like to export a torus in GMSH but this part doesn't define a volume (the torus is hallow, only surfaces are present in GMSH). However with a box or a cylinder, both define a closed volume in GMSH.

How can I change the topology of the torus in order to have the same as the cylinder or the box ?

Thanks in advance,

Best regards,

RomainM
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Export Torus

Post by wmayer »

Hi,

I'm not quite sure what you're planning to do. If I got you right then you have created a torus in GMSH and want to export it to FreeCAD. A torus in GMSH isn't a volume (i.e. a solid) but cylinders or boxes are solids in GMSH. I guess you want to load that torus into FreeCAD and there you want to convert it into a solid. What file format do you use for the data exchange? Do you have the parametric of the torus, i.e. the radii, ... If so you could create it in FreeCAD from scratch or isn't this practical?

Cheers,
Werner
RomainM

Re: Export Torus

Post by RomainM »

Hi wmayer,

I'm sorry of my bad problem explanations. In fact, I create a torus in FreeCAD and I export it in GMSH (brep file) but when the file is opened in GMSH, the torus is not a volume but just surfaces. Whereas when I do the same operations in FreeCAD for a cylinder, the exported file in GMSH (brep file again) give me a volume.

The torus and the cylinder primitives are not defined with the same rules. For instance, the boolean operation Union is not possible between a torus and a cylinder (whereas it is possible between a sphere and a cylinder, a cylinder and a box, ...)

Is there a python function to transform the torus in a closed volume thanks to these faces ?

Thanks in advance and sory again for my poor explanations about the problem,

Best Regards,

RomainM.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Export Torus

Post by wmayer »

Hi,
I'm sorry of my bad problem explanations. In fact, I create a torus in FreeCAD and I export it in GMSH (brep file) but when the file is opened in GMSH, the torus is not a volume but just surfaces. Whereas when I do the same operations in FreeCAD for a cylinder, the exported file in GMSH (brep file again) give me a volume.
Ah, then it's the other way round. I just have realized that there is a bug in the dialog where to create the torus. Instead of returning a solid object we return a shell object. The final shape then is also a shell. The bug is already fixed.

For the moment you can use the Python method Part.makeTorus() which works correctly. The method accepts 7 parameters:
* radius 1, float (mandatory)
* radius 2, float (mandatory)
* position, App.Vector (optional)
* direction, App.Vector (optional)
* angleU, float (optional)
* angleV1, float (optional)
* angleV2, float (optional)

Cheers,
Werner
RomainM

Re: Export Torus

Post by RomainM »

Hi wmayer,

Thank you so much for your quick answer. Your method, previously described, works perfectly.

Best regards,

RomainM.
Post Reply