Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
bzb.dev001
Posts: 102
Joined: Sun May 05, 2019 3:08 am

Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post by bzb.dev001 »

Using the Part wb. I've created a spiral. Is there a quick way of finding the length of the spiral.
0.png
0.png (30.59 KiB) Viewed 1704 times
Last edited by Kunda1 on Wed Jul 06, 2022 5:14 pm, edited 2 times in total.
Reason: Added GH ticket number to thread title
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Length of a spiral

Post by vocx »

bzb.dev001 wrote: Mon Oct 07, 2019 5:03 am Using the Part wb. I've created a spiral. Is there a quick way of finding the length of the spiral.
I'm surprised that the length of the spiral object is not shown in the property editor. I think it should be.

All topological shapes have certain properties. You can inspect them from the Python terminal.

Use the selection view to get the Python object in the terminal, then inspect the Shape.

Code: Select all

obj.Shape.Length
# or
App.ActiveDocument.Spiral.Shape.Length
You can also inspect other properties like

Code: Select all

obj.Shape.Area # for faces
obj.Shape.Volume # for solids
obj.Shape.Vertexes # points in the shape
obj.Shape.Edges # lines that make the shape
# and others
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
pl7i92LCNC
Posts: 208
Joined: Tue Mar 12, 2019 3:03 pm
Location: RLP DE

Re: Length of a spiral

Post by pl7i92LCNC »

there shoudt be a general inspection tool in the workbenches
thschrader
Veteran
Posts: 3157
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Length of a spiral

Post by thschrader »

pl7i92LCNC wrote: Mon Oct 07, 2019 8:59 am there shoudt be a general inspection tool in the workbenches
It is... :)
arch-wb, survey-tool
spiral_survey_tool.JPG
spiral_survey_tool.JPG (81.29 KiB) Viewed 1662 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4159 - Show spiral length in the property editor (was: Length of a spiral)

Post by Kunda1 »

issue #4159 was opened regarding this issue.
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
chennes
Veteran
Posts: 3914
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4159 - Show spiral length in the property editor (was: Length of a spiral)

Post by chennes »

vocx wrote: Mon Oct 07, 2019 6:15 am I'm surprised that the length of the spiral object is not shown in the property editor. I think it should be.
Kunda1 wrote: Fri Mar 27, 2020 1:23 pm issue #4159 was opened regarding this issue.
Is there precedent for this feature elsewhere in FreeCAD? I was looking into implementing it, but actually none of the primitives in Part display any sort of Read-Only calculated geometrical information in the property editor, as far as I can see. If Length makes sense for Spiral, it probably makes sense for Line, too (for example). I ask in part because I was hoping to borrow the code from someplace else: it's easy enough to add an Output property to the list, but I don't actually know how to get OCCT to tell me the length of the spiral.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post by Kunda1 »

Ticket migrated to issue #5995
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
adrianinsaval
Veteran
Posts: 5552
Joined: Thu Apr 05, 2018 5:15 pm

Re: Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post by adrianinsaval »

@chennes what's your take on the matter now? IMO if it's gonna be implemented here it should be implemented everywhere including other shape properties like area and volume for surfaces and solids respectively, otherwise just close the issue and keep this as a property obtained trough python.

It could potentially be shown in the property view as children of the shape property of every object that has it, showing Length (sum of all edges), Area (sum of all faces) and Volume (sum of all solids). Not sure how to manage compounds.
User avatar
chennes
Veteran
Posts: 3914
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post by chennes »

Well, I personally would love an easy, GUI-based way to get basic stats about selected entities like this -- but my original question stands, about whether there is any precedent for this in FreeCAD. Of course we have read-only properties, but what about displaying calculated properties like this?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5552
Joined: Thu Apr 05, 2018 5:15 pm

Re: Ticket #5995 - Show spiral length in the property editor (was: Length of a spiral)

Post by adrianinsaval »

At the very least I know there are properties calculated from other properties in an object in PD Helix (and which property is calculated changes depending on the Mode), don't know if there is any calculated from shapes.
Post Reply