Porting STEP reader to new Part Design

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
vejmarie
Posts: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Porting STEP reader to new Part Design

Postby vejmarie » Sun Mar 19, 2017 5:12 pm

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
vejmarie
Posts: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Porting STEP reader to new Part Design

Postby vejmarie » Sun Mar 19, 2017 5:31 pm

User avatar
NormandC
Posts: 12066
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Porting STEP reader to new Part Design

Postby NormandC » Sun Mar 19, 2017 8:50 pm

vejmarie wrote:I am based on this drawing

It should be rather the one after labelled v2. ;)
vejmarie
Posts: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Porting STEP reader to new Part Design

Postby vejmarie » Sun Mar 19, 2017 9:19 pm

NormandC wrote:
vejmarie wrote:I am based on this drawing

It should be rather the one after labelled v2. ;)


Agree my initial pointer is not good :(
DeepSOIC
Posts: 4466
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Porting STEP reader to new Part Design

Postby DeepSOIC » Sun Mar 19, 2017 9:26 pm

Hi!
vejmarie wrote:part but they can't be included easily to each other using call to addObject()
Please explain. They can, see Part-o-magic.
vejmarie
Posts: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Porting STEP reader to new Part Design

Postby vejmarie » Sun Mar 19, 2017 9:58 pm

DeepSOIC wrote:Hi!
vejmarie wrote:part but they can't be included easily to each other using call to addObject()
Please explain. They can, see Part-o-magic.


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
Posts: 4466
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Porting STEP reader to new Part Design

Postby DeepSOIC » Sun Mar 19, 2017 10:02 pm

Code: Select all

asy = App.ActiveDocument.addObject("App::Part", "Assembly")
part = asy.newObject("App::Part", "Part")

result:
nested-part-creation.png
nested-part-creation.png (43.18 KiB) Viewed 168 times

It is python of course, but in C++ you can something like Base::Interpreter::runString("code") or doCommand(code) or whatever, if you're desperate.
ickby
Posts: 2418
Joined: Wed Oct 05, 2011 7:36 am

Re: Porting STEP reader to new Part Design

Postby ickby » Mon Mar 20, 2017 9:13 am

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: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Porting STEP reader to new Part Design

Postby vejmarie » Mon Mar 20, 2017 10:33 am

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.


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) ...
vejmarie
Posts: 443
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Porting STEP reader to new Part Design

Postby vejmarie » Wed Mar 22, 2017 8:28 pm

Ok, it works. Just issued a PR to integrate that code.