[Feature Request] Sketch - Identify Geometry Index (inside and outside Edit Mode)

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: [Feature Request] Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

Thanks for updating :)
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

realthunder wrote: Sun Jul 14, 2019 11:16 pm
I will try merge the Link functionality first, and followed by the topo naming thing including the sketch export. Hopefully it can get into 0.19 in time.
[/quote]

I understand your branch tackled toponaming issue.

Not exactly same problem - In current sketcher implementation, if one edit primarily delete some edges, the edge indexes are 're-ordered', so 'link to external geometry ' to this sketch (link by its edge index) would fails / point to 'wrong' edges.

Wonder whether in your implementation, this is also resolved?

Thanks again.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by realthunder »

paullee wrote: Sat Jul 20, 2019 11:52 pm I understand your branch tackled toponaming issue.

Not exactly same problem - In current sketcher implementation, if one edit primarily delete some edges, the edge indexes are 're-ordered', so 'link to external geometry ' to this sketch (link by its edge index) would fails / point to 'wrong' edges.

Wonder whether in your implementation, this is also resolved?

Thanks again.
Yes, it is solved. That is one of the fundamental requirement of a topo naming implementation. In my branch, both external and internal edges in a sketch has an additional integer ID that is unique within the owner sketch, and will not change. Other shapes extruded from the sketch will name their faces and edges based on those IDs, so they should be stable too. And various link properties will use the stable name automatically.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: [Feature Request] Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

Thanks. Look forward to the improvements !
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

realthunder wrote: Sun Jul 21, 2019 12:23 am ping
There is a discussion about Changing a line to a constructor confuses freecad

Sorry always pinging you as I am not sure which and if features in this discussion has been merged :)

Thanks
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: [Feature Request] Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

Thanks for the pointer :)

Related though not exactly the same, but should be very useful :)
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by realthunder »

paullee wrote: Sat Aug 22, 2020 11:16 am
The sketch edge naming is the first step I did for the topo naming feature. It hasn't been merged yet. Should come in 0.20.

The edge names do differ for 'edit mode' and 'shape mode'. But as long as the edge exists, you can always refer to the edge using its 'internal edit mode' name. The construction mode just toggles the visibility of that edge in 'shape mode', but the name stays the same regardless how many times it is toggled.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

realthunder wrote: Sun Aug 23, 2020 1:38 am The edge names do differ for 'edit mode' and 'shape mode'. But as long as the edge exists, you can always refer to the edge using its 'internal edit mode' name. The construction mode just toggles the visibility of that edge in 'shape mode', but the name stays the same regardless how many times it is toggled.
Thanks for the explanation !

The below feature seems resolved the original problem - I originally thought needs 'uniting' the 'internal/edit' mode edge and 'external/shape' mode, but seems below features works, not yet test though :)

Feature Request: Make SketchObject::getGeoVertexIndex available from the Python script side of things
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Sketch - Identify Geometry Index (inside and outside Edit Mode)

Post by paullee »

realthunder wrote: Ping
Hi Realthunder. Following recent discussion understanding about ID in sketch, I am trying to get the info about the edge you advised inside and outside Edit Mode of sketch.

But it seem getSelectionEx() only return Edge name ( see screencaptures) - e.g. s.SubElementNames >>> ('Edge1',)
, but Selection panel show - ....Sketch;g11, SKT_Edge1

BTW, what g11 is about ?

Thanks for any idea.

realthunder wrote: Fri Mar 23, 2018 10:18 am Just stumbled upon this thread. This feature has been added to my branch when I implemented SketchExport, as you've already known. In my branch, the sketch elements are using the same name (but with different prefix for disambiguation) in and out of the edit mode. The ending integer (i.e. the 4 in ;SKT_g4) is the geometry ID, which is a new attribute (named ID) I added. You can match them (Sketch.Geometries) in a loop.
Screenshot from 2018-03-23 18-08-00.png
Screenshot from 2018-03-23 18-08-00.png (239.27 KiB) Viewed 1029 times
Screenshot from 2020-11-08 00-56-52.png
Screenshot from 2020-11-08 00-56-52.png (236.97 KiB) Viewed 1029 times
Post Reply