Part Geometry Extensions

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Kunda1
Posts: 4803
Joined: Thu Jan 05, 2017 9:03 pm

Re: Part Geometry Extensions

Postby Kunda1 » Sat Jul 13, 2019 4:36 pm

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!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
easyw-fc
Posts: 2588
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Postby easyw-fc » Wed Jul 17, 2019 1:00 pm

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
Site Admin
Posts: 14451
Joined: Thu Feb 19, 2009 10:32 am

Re: Part Geometry Extensions

Postby wmayer » 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.
User avatar
easyw-fc
Posts: 2588
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Postby easyw-fc » Wed Jul 17, 2019 5:15 pm

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
Posts: 2588
Joined: Thu Jul 09, 2015 9:34 am

Re: Part Geometry Extensions

Postby easyw-fc » 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...
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Part Geometry Extensions

Postby abdullah » Sun Jul 21, 2019 5:57 am

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
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Part Geometry Extensions

Postby abdullah » Sun Jul 21, 2019 6:39 am

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
Posts: 1600
Joined: Wed May 04, 2016 3:58 pm

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

Postby paullee » Sat Jul 27, 2019 6:54 pm

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 138 times
Attachments
Test_ GeometryExtension_ Sketcher_ 1.fcstd
(3.42 KiB) Downloaded 1 time
paullee
Posts: 1600
Joined: Wed May 04, 2016 3:58 pm

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

Postby paullee » Sat Jul 27, 2019 6:56 pm

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
Posts: 1600
Joined: Wed May 04, 2016 3:58 pm

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

Postby paullee » Wed Jul 31, 2019 11:06 am

Same as of:-

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