Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistencies in PartDesign BaseFeature #13786

Open
2 tasks done
NomAnor opened this issue May 2, 2024 · 4 comments
Open
2 tasks done

Inconsistencies in PartDesign BaseFeature #13786

NomAnor opened this issue May 2, 2024 · 4 comments
Labels
Feature FR for improvements or new features Missing: forum discussion MIssing a forum post discussion with the FC community UI/UX WB Part Design Related to the Part Design Workbench

Comments

@NomAnor
Copy link
Contributor

NomAnor commented May 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

When a PartDesign::Body is created from a Part::Feature a PartDesign::FeatureBase is automatically created to reference the Part::Feature. Its "Base Feature" property is setup to allow global links:

FeatureBase::FeatureBase()
{
BaseFeature.setScope(App::LinkScope::Global);
BaseFeature.setStatus(App::Property::Hidden, false);
}

Additionally the PartDesign::Body "Base Feature" property is synced with the PartDesign::FeatureBase property:

void FeatureBase::onChanged(const App::Property* prop) {
// the BaseFeature property should track the Body BaseFeature and vice-versa
if (prop == &BaseFeature) {
trySetBaseFeatureOfBody();
}
Part::Feature::onChanged(prop);
}

but the PartDesign::Body only allows local links (as default, inherited from Part::BodyBase).

Full version info

OS: Arch Linux (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36695 (Git)
Build type: Debug
Branch: main
Hash: 6c0865a7b974cd8100585a42a9b2d21643be871f
Python 3.11.8, Qt 5.15.13, Coin 4.0.2, Vtk 9.3.0, OCC 7.3.0
Locale: German/Germany (de_DE)
Installed mods: 
  * Manipulator 1.5.7
  * ThreadProfile 1.84.0
  * DynamicData 2.60.0
  * lattice2 1.0.0
  * 3D_Printing_Tools
  * freecad.gears 1.0.0
  * Assembly3 0.11.3
  * QuickMeasure 2022.10.28
  * fasteners 0.4.21

Subproject(s) affected?

PartDesign

Anything else?

As explained in #13762, I was trying to create a base body and then create multiple bodies from it to add some PartDesign features and use them a bodies in parts. I use App::Part containers as parts which then contain one or more bodies (not necessary PartDesign::Body).

Essentially I want to end up with this:
basefeature

Two problems arise from this:

  1. The Part cube is automatically added to the App::Part of the newly created body

  2. Rearanging the tree manually will give the warning

    PartDesign::Body: Link(s) to object(s) 'Box' go out of the allowed scope 'Body'. Instead, the linked object(s) reside within 'N/A'.

    about the link scope, coming from the Body, not the BaseFeature because of the different scopes of the "Base Feature" properties.

It seems that base features were intended to link to global objects. Should the Body "Base Feature" property be changed accordingly?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz
Copy link
Collaborator

maxwxyz commented May 2, 2024

why not use shape binders and make a new option to them to be like real geometry?

@maxwxyz maxwxyz added WB Part Design Related to the Part Design Workbench UI/UX Feature FR for improvements or new features Missing: forum discussion MIssing a forum post discussion with the FC community labels May 2, 2024
@NomAnor
Copy link
Contributor Author

NomAnor commented May 3, 2024

I'm not sure if I like this option from a users perspective. ShapeBinders are currently used as reference objects in a PartDesign::Body (same as Sketches and Datums). This would mean some shape binders will become PartDesign::Features in some circumstances which would be confusing.

The PartDesign::FeatureBase is already there, it just needs to be more generic in what objects it allows to reference. The restriction only seems to be in the UI code. I removed the if and it seems to work fine.

If the local link scope of the bodies "Base Feature" is necessary for other reasons, maybe there is a way to still allow to use the FeatureBase to have global scope without warnings? Why are the "Base Feature" properties synced?

@FlachyJoe
Copy link
Contributor

why not use shape binders and make a new option to them to be like real geometry?

A ShapeBinder can already be solidified by a boolean fuse (with nothing else).

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 3, 2024

I know, to get rid of that extra step the ShapeBinder could have an extra attribute makeRealGeometry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature FR for improvements or new features Missing: forum discussion MIssing a forum post discussion with the FC community UI/UX WB Part Design Related to the Part Design Workbench
Projects
None yet
Development

No branches or pull requests

3 participants