[Gmsh] STEP import // tangent surface selection

postanmichel at yahoo.com postanmichel at yahoo.com
Tue Aug 30 08:56:00 CEST 2016


Hello Christophe,
in the OCC documentation it says:

"In addition to the translation of shapes implemented in basic 
translator, it [XDE] provides the following: [...]; Names of products 
are translated and assigned to assembly components and instances in XDE; 
[...]; Colors, layers, materials and validation properties assigned to 
parts or subparts are translated; [...];"

As far as I understand, XDE is a certain STEP format which is generated 
by the CAD tool when selecting export colors/names/etc. If I open such a 
STEP-file in Salome I get these names.

See following links with some reference to this topic.

A post at the opencascade forum with code: 
https://www.opencascade.com/content/import-step-export-mesh-wrong-placement-items
|STEPCAFControl_Reader aReader;|
|||aReader.SetColorMode(true);
aReader.SetNameMode(true);
aReader.SetLayerMode(true);|

A question on stackoverflow with some relevant code: 
http://stackoverflow.com/questions/34021383/how-to-import-step-files-with-opencascade-and-display-with-coin3d-with-correct-c
|STEPCAFControl_Reader stepReader;
stepReader.SetColorMode(true);
stepReader.SetNameMode(true);
stepReader.SetLayerMode(true);

|I also found some code which shows how it is implemented in PythonOCC. 
I know it is not exactly what we are looking for, but since this is a 
python-wrapper for C++ the code for C++ obviously isn't so different.
https://github.com/tpaviot/pythonocc-core/blob/master/examples/core_load_step_ap203_ocaf.py
step_reader = STEPCAFControl_Reader()
step_reader.SetColorMode(True)
step_reader.SetLayerMode(True)
step_reader.SetNameMode(True)
step_reader.SetMatMode(True)

I hope this helps. Let me know if you need more.

Best regards
Michael

Am 29.08.2016 um 23:21 schrieb cgeuzaine at ulg.ac.be:
>
>
> On 29 Aug 2016, at 22:33, Michael Hiller <postanmichel at yahoo.com 
> <mailto:postanmichel at yahoo.com>> wrote:
>
>> Hello Christophe,
>> did you ever get an answer to following archived email?
>>
>> http://onelab.info/pipermail/gmsh/2013/007826.html
>>
>> <http://onelab.info/pipermail/gmsh/2013/007826.html>
>
> No...
>
>> <http://onelab.info/pipermail/gmsh/2013/007826.html>
>> I am not a coding expert but I found following description on the 
>> occ-site which seems to be exactly what me and the Matthias were 
>> looking for:
>>
>> https://www.opencascade.com/doc/occt-6.7.0/overview/html/user_guides__step.html#occt_step_7_1_1
>
> Isn't this describing another file format (XDE) ?
>
> If you find some examples showing code to extract useful 
> coloring/grouping info from step or brep files don't hesitate to post 
> them: it's still something we would like to explore (eg to define 
> physical groups automatically)
>
>
>>
>> It would be great if you could implement color and name STEP import.
>>
>> There seems to be the possibility for layer import as well which 
>> would be a nice extra:
>> https://www.opencascade.com/doc/occt-6.9.1/refman/html/class_s_t_e_p_c_a_f_control___reader.html#afa81144a8d9116e1ffa0af30a70f928e
>>
>> Let me know if I can check or provide more information.
>>
>> Thank you and best regards
>> Michael
>>
>>
>> ------------------------------------------------------------------------
>> *From:* Michael Hiller <postanmichel at yahoo.com 
>> <mailto:postanmichel at yahoo.com>>
>> *To:* "gmsh at geuz.org <mailto:gmsh at geuz.org>" <gmsh at geuz.org 
>> <mailto:gmsh at geuz.org>>
>> *Sent:* Thursday, August 25, 2016 12:55 PM
>> *Subject:* STEP import // tangent surface selection
>>
>> Dear Gmsh developers, dear users,
>>
>> first of all I want to thank you for fixing the higher order compound 
>> feature – it works like charm now!
>>
>> I am trying to find a solution how to easily define "Compound 
>> Surfaces" now. I have a solid STEP model with almost 1500 surface 
>> patches. In the end I want all patches that share a tangent edge to 
>> be meshed together as a single compound mesh.
>>
>> At the moment I have to manually select the patches. It helps to hide 
>> by group selection with pressing STRG and drawing a rectangular box 
>> in the GUI. But still this is cumbersome for the complete part.
>>
>> So I was thinking maybe there is something like "Reclassify 2D" for 
>> STEP files which I couldn’t find.
>>
>> Unfortunately I also cannot use some helpful STEP options like 
>> exporting feature names or surface colors. With the first option I 
>> could do the compound definitions inside CAD. This would generally be 
>> a neat feature: you could parametrically define interfaces inside CAD 
>> and use them in GMSH for physical entities. I think that the OCC 
>> kernel provides option.
>>
>> Also I don't see an obvious way how to change the surface IDs stored 
>> inside the STEP file. This could help by writing a little python 
>> script to group surfaces by ordering them inside the step file.
>>
>> I would be very happy if anyone could provide some further ideas on 
>> how to approach this more conveniently.
>>
>> Thank you and best regards
>> Michael
>>
>>
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20160830/af0e8625/attachment-0001.html>


More information about the gmsh mailing list