Dependency question

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jrheinlaender
Posts: 554
Joined: Sat Apr 07, 2012 2:42 am

Dependency question

Post by jrheinlaender »

Hi,

not sure whether we have a dependency mess here. I implemented parametric Datum features in the PartDesign module. But one of the main reasons to have datum features is in order to use them as sketch planes and as external references in sketches. This means that the Sketcher module will depend on PartDesign. Is that OK?

Jan
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Dependency question

Post by jriegel »

Yes, you have a dependency mess ;)

PartDesign don't depend on the sketcher, rather on the Part2DObject defined in Part. Sketcher just inheriting this object.
You need a common base class like App::Plane or something in Part. With this the Sketcher don't relay on a specific class, rather to a base class which can derived in other modules for additional purposes.

The Sketcher should depend on Part module alone, the same as PartDesign. Everything else will lead to a big fat blob where everything depend on everything and we don't need modules any more....
Stop whining - start coding!
jrheinlaender
Posts: 554
Joined: Sat Apr 07, 2012 2:42 am

Re: Dependency question

Post by jrheinlaender »

So what are the options for implementing datum features:

1. PartDesign is not an option
2. Part is possible, but wouldn't it be confusing to have both parametric and non-parametric planes in Part?
3. A base class like App::Plane would again mean we have App::Plane non-parametric plus App::DatumPlane which is parametric... or should App::Plane just become parametric instead?

So probably Part:: is still the best option. Do we actually need non-parametric planes in Part? Or can we have one DocumentObject that is guided either by the Placement or by its References, depending on what the user chooses?
logari81
Posts: 658
Joined: Mon Jun 14, 2010 6:00 pm

Re: Dependency question

Post by logari81 »

Jan, I think you just need to derive your PartDesign::Plane from App::Plane. So the sketch needs to depend only on App::Plane.

In PartDesign::Plane you would just add some functionality e.g. to calculate the Placement property from some references.

This is also how the SketchBased features in PartDesign work they do not depend on a Sketcher::SketchObject but on the parent class Part::Part2DObject.

Right?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Dependency question

Post by jriegel »

Logari is exactly right. You can surly place the Datum feature in PartDesign, you have just to choose a base class which can be used by Sketcher. Thats e.g. App::Plane or something in Part.
Stop whining - start coding!
Post Reply