[FeatureRequest] Sketcher: Add additional information to geometry

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

[FeatureRequest] Sketcher: Add additional information to geometry

Post by furti »

As I played quite a bit with the Arch Workbench in FreeCAD and I like to base the Arch geometry on Sketches because of the greate flexibility and power that comes with a Sketch, something came to my mind.

Would it be possible, to extend the Sketcher functionality so that one can add tags to the geometry in Sketcher?


Let's say we have this floor plan
floor_plan.png
floor_plan.png (4.74 KiB) Viewed 1463 times
Now I want to double click all the blue lines and give them a tag of "outside".
Then I double click all the grey walls and give them a tag of "inside".

Now a Tool like the "Arch Floor", that is based on this sketch could read all available tags and give the user the option to add some settings for each tag:
outside
- Material A
- Thickness X
inside
- Material B
- Thickness Y

With this Information the tool can generate all the walls for this Floor. When one wants to add another wall, simply add more geometry and give it the appropriate tag.

Or the PartDesign "Hole" feature can be based on a Sketch like this:
holes.png
holes.png (5.03 KiB) Viewed 1463 times
Now one can tag the small circles with "M4" and the big circles with "M8" and the Hole feature can use this Information and generate the appropriate holes.


I think this might be a pretty useful feature. What do you think about it?
abdullah wrote: ping
@abdullah Do you think something like this would be technically possible to implement?
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by Jee-Bee »

I don't see any reason to give the properties (like thickness and material) inside sketcher
For me that type of properties belongs to a solid. In my opinion it would be great to give an object a material specification. Not only for arch but also in part( design).

To give an sketcher object an additional name... I think i don't use it. I expect that i prefer as i do now create multiple sketcher objects and name them.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by furti »

Jee-Bee wrote: Mon May 20, 2019 6:40 pm I don't see any reason to give the properties (like thickness and material) inside sketcher
That was not what I had in mind. Inside Sketcher you only define a tag, or a name, whatever you want to call it, for the geometry. And other tools use this Information.

Jee-Bee wrote: Mon May 20, 2019 6:40 pm I expect that i prefer as i do now create multiple sketcher objects and name them.
Maybe one can save some time. No need to create a master sketch, additional sketches per wall type, link them togehter. Simply a single sketch and give each line a name.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by Jee-Bee »

Ahh check
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by chrisb »

I see that this can be convenient, however it would make models even more difficult to understand, because it introduces a new layer of complexity. If certain lines of a sketch have a different meaning, put them in a new sketch.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by abdullah »

furti wrote: Mon May 20, 2019 5:30 pm As I played quite a bit with the Arch Workbench in FreeCAD and I like to base the Arch geometry on Sketches because of the greate flexibility and power that comes with a Sketch, something came to my mind.

Would it be possible, to extend the Sketcher functionality so that one can add tags to the geometry in Sketcher?


Let's say we have this floor plan
floor_plan.png

Now I want to double click all the blue lines and give them a tag of "outside".
Then I double click all the grey walls and give them a tag of "inside".

Now a Tool like the "Arch Floor", that is based on this sketch could read all available tags and give the user the option to add some settings for each tag:
outside
- Material A
- Thickness X
inside
- Material B
- Thickness Y

With this Information the tool can generate all the walls for this Floor. When one wants to add another wall, simply add more geometry and give it the appropriate tag.

Or the PartDesign "Hole" feature can be based on a Sketch like this:
holes.png

Now one can tag the small circles with "M4" and the big circles with "M8" and the Hole feature can use this Information and generate the appropriate holes.


I think this might be a pretty useful feature. What do you think about it?
abdullah wrote: ping
@abdullah Do you think something like this would be technically possible to implement?
I think Geometry Extensions is what you want:
https://github.com/FreeCAD/FreeCAD/pull/2098

You can add basic information to geometries: strings, booleans, ...

Then how to use that information is another thing. This intelligence can reside in a macro, in arch WB, custom WB,...
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by furti »

abdullah wrote: Tue May 21, 2019 6:46 pm You can add basic information to geometries: strings, booleans, ...
This sounds exactly like what I proposed. Awesome :)
chrisb wrote: Tue May 21, 2019 6:39 am however it would make models even more difficult to understand
In my opinion it might make models more easy to understand. Especially the high level tools like Arch can benefit from this.
Lets take the arch window for example. You have multiple wires with different meanings in a single sketch. One is a frame one is a glass panel. When i want to know what wire is used for what part i have to dive deep into the window configuration.
Would be easier when the edges inside sketcher are named "frame" or "glass_panel".

Also for more complex models it might make life easier. You can tag certain geometry inside a master sketch so that it is clear what the purpose of an edge is. When you come back to the model a few years later, you have everything inside the master sketch to understand the overall structure of the model. No need to search around where certain geometry of the master sketch is linked :)
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by chrisb »

I see that for a master sketch approach this can indeed be helpful.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by easyw-fc »

abdullah wrote: Tue May 21, 2019 6:46 pm
I think Geometry Extensions is what you want:
https://github.com/FreeCAD/FreeCAD/pull/2098

You can add basic information to geometries: strings, booleans, ...

Then how to use that information is another thing. This intelligence can reside in a macro, in arch WB, custom WB,...
Yummi! ...
this seems perfect for my StepUp WB, adding i.e. pin number to Sketch Geometries when creating a KiCAD footprint in FreeCAD :D
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [FeatureRequest] Sketcher: Add additional information to geometry

Post by abdullah »

furti wrote: Wed May 22, 2019 4:14 am This sounds exactly like what I proposed. Awesome :)
easyw-fc wrote: Wed May 22, 2019 12:30 pm Yummi! ...
this seems perfect for my StepUp WB, adding i.e. pin number to Sketch Geometries when creating a KiCAD footprint in FreeCAD
Well, I am happy that you have so many use cases already for them.

Now that you say it, it could be pin number, the reference of the ICs, and any other associated information, or an attribute to represent a Geometry in another colour...

The "good part" of Geometry extensions is that for the rest of the players, like existing WBs it is fully transparent. They do not know the extensions are there. They do not care. They handle the geometry without being aware of the extensions. This way, some WBs can extend the functionality of others (make use of their core functionality without modifying them) to leverage specific functionality...

... well, it was intended to be all that... but it is rather untested yet. Hopefully there are no major things.
Post Reply