Just have another question regarding the importation of geometry and how two sets of lines are created if the geometry of the tow becomes too circular. This creates problems when it comes to other software packages trying to recreate the volume as it gets confused over which lines to use.
Are you aware of this? i have attached an example.
Regards,
Charles
Geometry importation
Moderators: Martin, Developers
-
Martin
Hi Charles,
I've cut and pasted your email to the forum. Please post messages here directly in the future.
I'm a little confused by your post, could you please detail exactly what you are trying to do? I assume you are exporting geometry from TexGen to IGES or STEP and importing into some 3rd party software (which one?).
From TexGen v3.0.3 you can select some options when exporting to IGES or STEP. You have the option to create a faceted volume, please have a go with that and let me know if it works better or not. The problem with faceted geometry is that on mesh creation the mesh is generally restricted to the facet edges.
With smooth geometry the meshing package has less restrictions on creating the mesh. However this does tend to cause some problems, the IGES/STEP yarn surface is created by essentially fitting a parametric surface to a set of points. It is necessary to specify where the surface is discontinuous in the first order otherwise strange shapes will result. For example, a lenticular cross section has 2 first order discontinuities, one at each side. In the case of a lenticular cross section, two lines are created along the edge of the yarn which represent the discontinuities. This is handled automatically by TexGen and should work for fairly simple cases like the one you have shown me.
However, the matter is complicated further when the cross section varies along the length of a yarn. For example changing from a lenticular cross section with two discontinuities to an ellipse with no discontinuities. Again TexGen has an algorithm to handle this, however these complicated cases can cause the OpenCASCADE library to crash. OpenCASCADE is the library used to aid converting from the internal TexGen geometry representation to IGES/STEP file geometry representation.
Unfortunately a lot of these issues are related to the OpenCASCADE software making it difficult for me to resolve them without spending a large amount of time finding out and understanding what algorithms OpenCASCADE is using to fit a surface to the list of points supplied by TexGen.
Martin.
I've cut and pasted your email to the forum. Please post messages here directly in the future.
I'm a little confused by your post, could you please detail exactly what you are trying to do? I assume you are exporting geometry from TexGen to IGES or STEP and importing into some 3rd party software (which one?).
From TexGen v3.0.3 you can select some options when exporting to IGES or STEP. You have the option to create a faceted volume, please have a go with that and let me know if it works better or not. The problem with faceted geometry is that on mesh creation the mesh is generally restricted to the facet edges.
With smooth geometry the meshing package has less restrictions on creating the mesh. However this does tend to cause some problems, the IGES/STEP yarn surface is created by essentially fitting a parametric surface to a set of points. It is necessary to specify where the surface is discontinuous in the first order otherwise strange shapes will result. For example, a lenticular cross section has 2 first order discontinuities, one at each side. In the case of a lenticular cross section, two lines are created along the edge of the yarn which represent the discontinuities. This is handled automatically by TexGen and should work for fairly simple cases like the one you have shown me.
However, the matter is complicated further when the cross section varies along the length of a yarn. For example changing from a lenticular cross section with two discontinuities to an ellipse with no discontinuities. Again TexGen has an algorithm to handle this, however these complicated cases can cause the OpenCASCADE library to crash. OpenCASCADE is the library used to aid converting from the internal TexGen geometry representation to IGES/STEP file geometry representation.
Unfortunately a lot of these issues are related to the OpenCASCADE software making it difficult for me to resolve them without spending a large amount of time finding out and understanding what algorithms OpenCASCADE is using to fit a surface to the list of points supplied by TexGen.
Martin.
-
Jon
Hi Charles,
Depending on what code/CAD package you're using, there might be a better way around the geometry issue if you're having problems using step or iges. I've done quite a bit of work on recreating the textile model with a Python script for Abaqus, and it works quite well. Even if you're not using a CAD package with a Python interface, then as long as it has some kind of scripting language it wouldn't be too difficult to write a C++ program or a Python function which does something like this:
open a text file for writing (this will be your CAD script)
This would give you a script file which you could run through your CAD package to recreate the geometry in a native format. There may be slight deviations from the TexGen model if your package uses different functions for the cross sections and surfaces, but these can be minimised by using CYarn.SetResolution() to force output of a lot of points, effectively forcing the CAD surface to match the TexGen surface.
Hope this helps,
Jon.
Depending on what code/CAD package you're using, there might be a better way around the geometry issue if you're having problems using step or iges. I've done quite a bit of work on recreating the textile model with a Python script for Abaqus, and it works quite well. Even if you're not using a CAD package with a Python interface, then as long as it has some kind of scripting language it wouldn't be too difficult to write a C++ program or a Python function which does something like this:
open a text file for writing (this will be your CAD script)
Code: Select all
for each of the yarns:
for each of the slave nodes:
retrieve all of the points on the cross section
write the code to create a polyline/spline/whatever to represent the cross section to a file
write the code to sweep/loft/whatever to make all the cross-sections into a solid
write code to do whatever else you need, e.g. subtract the yarns from the domain
close the file
This would give you a script file which you could run through your CAD package to recreate the geometry in a native format. There may be slight deviations from the TexGen model if your package uses different functions for the cross sections and surfaces, but these can be minimised by using CYarn.SetResolution() to force output of a lot of points, effectively forcing the CAD surface to match the TexGen surface.
Hope this helps,
Jon.
-
Martin
Hi Charles,
I've updated the code to import TexGen v2 files into TexGen v3... Its in the form of a python script. The new script can now read the up vectors, so this should solve your problem.
It will be in the next release of TexGen, but if you want the fix now you can download it from here:
http://texgen.svn.sourceforge.net/viewv ... iew=markup
Put the downloaded TexGenv2.py in the following folder:
C:\Python25\Lib\site-packages\TexGen
Assuming you've installed python in the default location. Overwrite the existing file, next time you load up texgen the changes should take effect.
Martin.
I've updated the code to import TexGen v2 files into TexGen v3... Its in the form of a python script. The new script can now read the up vectors, so this should solve your problem.
It will be in the next release of TexGen, but if you want the fix now you can download it from here:
http://texgen.svn.sourceforge.net/viewv ... iew=markup
Put the downloaded TexGenv2.py in the following folder:
C:\Python25\Lib\site-packages\TexGen
Assuming you've installed python in the default location. Overwrite the existing file, next time you load up texgen the changes should take effect.
Martin.