Porting STEP reader to new Part Design
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Porting STEP reader to new Part Design
Hi,
I have started to play around with the new part design stuff to port our STEP reader using these objects instead of the Compound/Part feature. This shall accelerate the rendering and browsing phase of STEP/IGES etc ...
But I am getting lost, a STEP file is an assembly tree with root nodes which are main assembly and sub assemblies, and shape description. With the new part design I can easily create new part but they can't be included easily to each other using call to addObject(). I started to thought that I needed to create a master Part and then body's but body's can contain only Shape which seems to be created by the sketcher workflow (which is fine to me).
So, what are your recommendation to create a STEP tree structure with the new Part Design stuff.
I can try to build a Part tree, but still do not understand how in C++ I can easily add Part into a Part, an example will be really appreciated !
vejmarie
I have started to play around with the new part design stuff to port our STEP reader using these objects instead of the Compound/Part feature. This shall accelerate the rendering and browsing phase of STEP/IGES etc ...
But I am getting lost, a STEP file is an assembly tree with root nodes which are main assembly and sub assemblies, and shape description. With the new part design I can easily create new part but they can't be included easily to each other using call to addObject(). I started to thought that I needed to create a master Part and then body's but body's can contain only Shape which seems to be created by the sketcher workflow (which is fine to me).
So, what are your recommendation to create a STEP tree structure with the new Part Design stuff.
I can try to build a Part tree, but still do not understand how in C++ I can easily add Part into a Part, an example will be really appreciated !
vejmarie
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Porting STEP reader to new Part Design
I am based on this drawing https://forum.freecadweb.org/viewtopic. ... 57#p131721
Re: Porting STEP reader to new Part Design
It should be rather the one after labelled v2.vejmarie wrote:I am based on this drawing
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Porting STEP reader to new Part Design
Agree my initial pointer is not goodNormandC wrote:It should be rather the one after labelled v2.vejmarie wrote:I am based on this drawing
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Porting STEP reader to new Part Design
Hi!
Please explain. They can, see Part-o-magic.vejmarie wrote:part but they can't be included easily to each other using call to addObject()
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Porting STEP reader to new Part Design
That is a good news. Let me read all this stuff and get back to the forum if I don't find any options.DeepSOIC wrote:Hi!Please explain. They can, see Part-o-magic.vejmarie wrote:part but they can't be included easily to each other using call to addObject()
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Porting STEP reader to new Part Design
Code: Select all
asy = App.ActiveDocument.addObject("App::Part", "Assembly")
part = asy.newObject("App::Part", "Part")
Re: Porting STEP reader to new Part Design
In my local branch I fixed a few addObject problems... well I need to finalize that stuff sometime. Butin general it should work to add things to the "Group" property directly.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Porting STEP reader to new Part Design
Ok. Will keep you posted tonight (Europe time), but I am still facing issue to transfer one App::Part to another one when both are standing as root node into the graphical tree. I am using in that case something like pcPart->addObject(myparttotransfer) ...ickby wrote:In my local branch I fixed a few addObject problems... well I need to finalize that stuff sometime. Butin general it should work to add things to the "Group" property directly.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Porting STEP reader to new Part Design
Ok, it works. Just issued a PR to integrate that code.