Part Geometry Extensions

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Part Geometry Extensions

Post by Kunda1 »

wmayer wrote: Sat Jul 13, 2019 3:22 pm Yesterday my computer crashed and it will take me some more time to set-up an alternative.
Bummer!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Post by easyw-fc »

abdullah wrote: Sat Jun 08, 2019 10:08 am First, let's wait to the Geometry Extensions be merged.
Hi @abdullah which is the minimum FC release to test your merged geometry extensions?
I have checked with FC 019.17352 but it seems it has been merged later ...
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Part Geometry Extensions

Post by wmayer »

I have checked with FC 019.17352 but it seems it has been merged later ...
You need something like FC 019.17404 or FC 019.17405.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Post by easyw-fc »

wmayer wrote: Wed Jul 17, 2019 3:58 pm
I have checked with FC 019.17352 but it seems it has been merged later ...
You need something like FC 019.17404 or FC 019.17405.
Thx! :D
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Post by easyw-fc »

abdullah wrote: Fri Feb 15, 2019 7:17 pm I think I have finished the development. It won't be merged before v0.19. If you want to try it you may download the PR below.
Hi @abdullah
I've tested some coding in using your Geometry Extension.

Would it be possible to display and edit extension through the Gui, inside the sketcher?

i.e. I would like to create a sketch organized by a different extension label assigned to internal geo sections...
It would be nice if it would be possible to display extension value assigned to a geo (i.e. like it is done for Elements Extended naming) and edit its value(s) inside the Sketcher editing tool...
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Part Geometry Extensions

Post by abdullah »

wmayer wrote: Sat Jul 13, 2019 3:22 pm
abdullah wrote: Mon Jul 01, 2019 2:22 pm
Yesterday my computer crashed and it will take me some more time to set-up an alternative.
Sorry for your loss! and thanks for the merge... it was a nice surprise :)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Part Geometry Extensions

Post by abdullah »

easyw-fc wrote: Fri Jul 19, 2019 1:51 pm
abdullah wrote: Fri Feb 15, 2019 7:17 pm I think I have finished the development. It won't be merged before v0.19. If you want to try it you may download the PR below.
Hi @abdullah
I've tested some coding in using your Geometry Extension.

Would it be possible to display and edit extension through the Gui, inside the sketcher?

i.e. I would like to create a sketch organized by a different extension label assigned to internal geo sections...
It would be nice if it would be possible to display extension value assigned to a geo (i.e. like it is done for Elements Extended naming) and edit its value(s) inside the Sketcher editing tool...
Possible, it is.

In my mind, extensions were intended for power users. The idea for "editing" custom extensions by the user, python console aside, was creating custom controls (macros). However, I see different possibilities, ranging from property editors to show/edit (read-only / read-write), to adding only information for core sketcher extensions (like the ID). The thing is that after a request to see the id, one to show "that string label I have put will likely follow".

I think it is something to look into, but I would rather first see how this is being used. The extensions mechanism is very generic and flexible, but it is not really being taken advantage from yet. The core extensions defined for the sketcher are still "just there", not actually being used by the Sketcher yet.

Currently I am mostly reading books to improve my skills, as I am mobile without access to my computer. I might get access to an old laptop next week, but I am not sure how fast it will compile. Maybe you could create a ticket to look into this later on.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

[Crash Report] - - - Re: Part Geometry Extensions

Post by paullee »

abdullah wrote: Mon Jul 01, 2019 2:22 pm
Hi, testing further and find with following steps, FC crash :-
  1. Make a Sketch, draw a rectangle e.g.
  2. run below code
  3. FC CRASH :(

Code: Select all

>>> sg0=s.Geometry[0]

>>> sg0.setExtension(Part.GeometryStringExtension("300","width"))
>>> sg0.getExtensions()
[<GeometryStringExtension ('width', 300) >]

>> sg0.setExtension(Part.GeometryStringExtension("2800","height"))
>>> sg0.getExtensions()
[<GeometryStringExtension ('width', 300) >, <GeometryStringExtension ('height', 2800) >]

>>> sg0.setExtension(Part.GeometryStringExtension("200","width"))
CRASH
FreeCAD_0.19-17445-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage
on
Fedora30
Screenshot from 2019-07-28 02-43-13.png
Screenshot from 2019-07-28 02-43-13.png (132.78 KiB) Viewed 1696 times
Attachments
Test_ GeometryExtension_ Sketcher_ 1.fcstd
(3.42 KiB) Downloaded 44 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

[Bug? ] - - - Re: Part Geometry Extensions

Post by paullee »

Oh, further test:-
  1. Created the Sketch in post above, and set all the extension and save the file before crash
  2. Close and re-open the file
  3. Run getExentions(), but all information set is not found ?

    Code: Select all

    Gui.ActiveDocument=Gui.getDocument("Test__GeometryExtension__Sketcher__1")
    >>> s=Gui.Selection.getSelection()[0]
    >>> sg0=s.Geometry[0]
    >>> sg0.getExtensions()
    []
Anything missing?
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

[Crash & Bug Report ] - - - Re: Part Geometry Extensions

Post by paullee »

Same as of:-

FreeCAD_0.19-17499-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage
Post Reply