Finding area of an irregular shape.

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!
Post Reply
beargfr
Posts: 3
Joined: Tue Oct 19, 2021 1:59 pm

Finding area of an irregular shape.

Post by beargfr »

Promise, I have searched looking for a solution already, but since this is my very first foray into trying to learn how to use CAD software of any kind I confess to being overwhelmed by all the terminology and concepts that I don't know.

I have managed to create a 2D drawing of an irregular shape that consists of a series of connected arcs, all of different orientation and radii. This shape is in fact the outside perimeter of a swimming pool. I created it using the dimensions and reference points from a paper copy of the pool "blueprint". It was a struggle as I was learning, but I think I have managed to get all the segments drawn and connected using the Draft workbench, and I only had to add one (1) "fudge" line to close the shape. What I would like to do now is find out the area of the shape. I did find this post:

https://forum.freecadweb.org/viewtopic.php?t=45913

Where someone else had a similar question and I've been attempting to replicate that solution, but I'm not having any luck. I haven't yet been able to create a 'face' inside the outline, therefore the python command referenced in that response is failing with an error:

Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'App.Document' object has no attribute 'Face'


My FreeCAD version:
  • OS: Windows 10 Version 2009
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.19.24291 (Git)
    Build type: Release
    Branch: releases/FreeCAD-0-19
    Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
    Python version: 3.8.6+
    Qt version: 5.15.2
    Coin version: 4.0.1
    OCC version: 7.5.0
    Locale: English/United States (en_US)
I've attached a copy of the file I'm working with.

Sure would appreciate some guidance..
Thanks,
Bear
Attachments
PoolOutlineJoined.FCStd
(52.5 KiB) Downloaded 40 times
User avatar
Willem
Veteran
Posts: 1852
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Finding area of an irregular shape.

Post by Willem »

Welcome to the forum. I did not download and investigate your file but I think MacroFCinfo gives the information you want
edwilliams16
Veteran
Posts: 3111
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Finding area of an irregular shape.

Post by edwilliams16 »

Your shape doesn't have its ends joined up, so it isn't a closed curve making up a face. I think you may be better of making your outline in the sketcher. Padding it and selecting the top face, you can use the FCInfo macro to find its area. In the enclosed, I've used the sketcher. You can edit the arc radii and locate the arc centers, using horizontal and vertical constraints to match your dimensions. I've made the arcs meet tangentially. The result is much easier to change if you want to tweak dimensions.
Attachments
PoolOutlineJoined_EW.FCStd
(15.9 KiB) Downloaded 37 times
beargfr
Posts: 3
Joined: Tue Oct 19, 2021 1:59 pm

Re: Finding area of an irregular shape.

Post by beargfr »

Thanks for that, Ed. I *thought* I'd managed to get all the ends joined but I guess I either missed something or just didn't know how to do that correctly. The way I did that was, in the Draft workbench, I zoomed way in on the arc endpoints, left only the "nearby object" snap setting enabled, then used to move tool to move one arc until the two endpoints coincided and I got the visual indication of that. Constructing the drawing was really hard for me to figure out, and considering how much I don't know about using this tool I'm sure there has to be a better/easier way. The radii of all the arcs are 'critical' dimensions and those are given on my 'blueprint' along with the distances between 4 center points that are "inside" the perimeter of the pool, but there's not much else to work with. The locations of the 'external/exterior arc center points aren't given in the print.

If it's not too much trouble, how did you go about joining everything up?

Thanks,
Bear
edwilliams16
Veteran
Posts: 3111
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Finding area of an irregular shape.

Post by edwilliams16 »

I rarely use Draft. Sketcher seems more suitable for this job. I used the polyline tool with the M-key. https://wiki.freecadweb.org/Sketcher_CreatePolyline It connects everything up with tangential constraints. To close the loop, I made sure the final vertex showed selected. I had to delete the initial mandatory straight segment.
beargfr
Posts: 3
Joined: Tue Oct 19, 2021 1:59 pm

Re: Finding area of an irregular shape.

Post by beargfr »

Cool! Thanks for the work you did making that file. I took it and tweaked it, adding constraints for both the arc radii and center point distances from each other and now have what I think is a pretty darn good recreation of the shape.

I thought I'd get cute and use some commands in the python console to get the area and perimeter. They worked but I have no idea what units the results are in.

Code: Select all

>>> App.ActiveDocument.Body.Shape.Area
178988341.0254768
>>> App.ActiveDocument.Body.Shape.Length
153924.62478435008
>>> 
I'll try to figure out how to use FCInfo (I think it was?)

(cue Jeopardy theme)

Found and installed FCInfo, and it claims the area is 961 sq ft, which is believable. Nice.

Cheers,
Bear
Attachments
PoolOutlineJoined_ConstrainedArcRadiiAndCenters.FCStd
(15.85 KiB) Downloaded 31 times
edwilliams16
Veteran
Posts: 3111
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Finding area of an irregular shape.

Post by edwilliams16 »

Your sketch has two remaining degrees of freedom. One is rotation around the origin which isn't significant and is easily frozen. The remaining degree allows the shape to change. (Just pull on the sketch. ) You need to specify another dimension somewhere.
The python area is the total area which is approximately twice the area of the pool. It's in the internal units of sq mm.
Post Reply