Surface Area and Volume

Next
 From:  bemfarmer
5549.1 
Is there a script to calculate the surface area of a NURBS surface?

How about for a flat, 2D NURBS surface?

I'm using MoI to map the blocks of trees in an orchard, from Google Earth Maps, so 2D surface area would be helpful.

Square footage area would be converted to Acres, using a baseline distance, perhaps in Excel, for crop insurance purposes. The crop insurance guys
used to run quad bikes with GPS around to make the maps, but quit doing it.

I think I can export the MoI trace of the map to another application, to measure the area, or just measure rectangles and triangles, so it is a very low priority feature.

Thank you,
Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5549.2 In reply to 5549.1 
Hi Brian, there is not currently anything set up accessible to scripts for getting that information so it's not currently possible to make a script for those right now.

You'll need to use Alibre or ViaCAD for getting those measurements right now.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5549.3 In reply to 5549.2 
Thank you Michael.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5549.4 
Created a MoI map overlay trace of a fruit orchard from a google earth satellite map. MoI is so easy to use.
Used all polylines, with each block assigned a closed polygon.
Used Object names for some descriptions. May also use some colors.

Did a google search for "polygon area algorithm javascript."
For plain, plane, non-intersecting polygons, there is a simple algorithm for
calculating the area of the closed polygon. Top View eliminates the Z coordinates.
The algorithm seems to have several names, "the surveyors formula," "the shoelace algorithm," Gauss's area formula,"
and Greens theorem.

I think I will try to make a simple script to calculate the area of a polygon. It seems fairly easy. Just need the X,Y coordinates for all of the vertices,
in order starting from one vertex. The user would select one polygon at a time.
Also would need a baseline distance for the Map.
A qtr_qtr section contains 40 acres, and is 1320 feet on a side.

The script would only work for polygons, not for Nurbs curves in general.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  shayno
5549.5 
I would be very interested in a volume display of selected objects (up where the dimensions are displayed )
Dealing with precious metals and estimating their volume for costing purposes would be invaluable to me.
currently I have to export as an stl and open with rhino or minimagics to get this.

Or is there a script that can do this
cheers
shayne
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5549.6 In reply to 5549.5 
Hi shayne, it is something that I want to add to an extended properties dialog which has still not been fully designed yet.

It can't really go directly up in the area where the dimensions are displayed since that area is updated on every selection change, and calculating the volume of a solid requires a lot of calculation and repeating a heavy calculation all the time on every selection change would make for weird lags and poor behavior in general.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  shayno
5549.7 In reply to 5549.6 
Just another thing to add to the list huh
Thanks
shayne
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5549.8 
The Volume calculation looks very hard to me.
Here is a reference to some work at Berkeley:

BAD LINK: http://kingkong.me.berkeley.edu/~adarsh/Papers/SPM10.pdf

New Link: http://www.me.berkeley.edu/~mcmains/pubs/SPM2010KrishnamurthyMcMains.pdf

:-)

EDITED: 5 Oct 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5549.9 
Did a simple copy and paste from MoI, of an extruded polygon, into Alibre, as a bunch of 3d surfaces, including the face for which the acreage is needed,
as per Ralf-S. There is no need to stitch to solid in Alibre.
In Alibre, used the 3D Measurement tool to get square inch area of a face surface.
Just need to scale the MoI map trace to physical distance reality, before the paste, and convert the Alibre area to acres.
(Have not got arround to doing a MoI script to measure planar area of a polygon plane yet. Do not need such a script now. In my naivity, I think it is possible, just wondering about what order the sides of a closed polyline could be stored in, under different creation circumstances, and whether to extract the points by line segment, or by 2d polygon vertex?)

EDITED: 16 Nov 2012 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Kaël (KAEL)
5549.10 
yes, change the size of the object in a volume Desired, this will be great! It could allow the calculation of material and many other things, :)

-Kaël
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5549.11 
I've put together a planar 3d polygon face area measuring script, but it still has bugs.
The vector/point math is a bit confusing. Just need to properly code the remaining 10% incorrectness. :-)
I've been resisting asking for help. (The math is fairly simple...)

For a nurbs face area, and or volume, the complex nurbs Gaussian quadrature integration, like the Berkeley link, is
beyond my current ability.

EDITED: 6 Dec 2012 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  bemfarmer
5549.12 
Here is the PolygonFaceArea Script, as a slightly tested draft.
It does not work on circles, nor nurbs curves, just planar faces, with straight line edges.
It does work for such faces in 3D space, with x, y, and z coordinates.
There is a lot of switching between points and vectors, which seemed to be necessary.
Portions of several existing scripts were used, including "bisector line", "angle", and "switch from faces to edges".
The "duplicate borders" script was used to switch from edges, to the line segments, to get the vertexes = start points.
Do edges have start and end points?
The main reference is Allen Van Gelder, "Efficient computation of polygon area and polyhedron volume," which is chapter 11 in the
book "Graphic Gems V." This chapter can be downloaded. It is not necessary to compute the surface normal.
Also looked at a JAVA program which used surface normals. Also looked at a Fast Polygon method, which uses projection and Newell Normals,
and is computationally more efficient.
The script only does one face at a time. It needs to be tested more.
The script should probably clean up the extra edge lines generated, and have sequential selections improved.

An early draft worked at the origin. Subsequent drafts refused to work, for a long time, without using vectors, and generated the area as 1.#QNB which
may indicate trying to display points as area values...

EDITED: 6 Dec 2012 by BEMFARMER


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All