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
Dependency question
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 554
- Joined: Sat Apr 07, 2012 2:42 am
Re: Dependency question
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....
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!
-
- Posts: 554
- Joined: Sat Apr 07, 2012 2:42 am
Re: Dependency question
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?
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?
Re: Dependency question
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?
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?
Re: Dependency question
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!