Mass calculation from ditch

Hello, I’m new to Grasshopper. i’m trying to learn how to calculate mass from a ditch ive made with lines. I will link my GH script with rhino model for a better understanding.

Calculate mass (M3) from lines(updated).gh (17.1 KB)

Surface.3dm (195.3 KB)


I know, but much of it is missing:

Sorry! my bad, here is a updated version without the quadri plugin
This should work with the Rhino model
Calculate mass (M3) from lines(updated).gh (17.1 KB)

Aaaaaaaaargh :sweat_smile:


Are you looking for the volume contained between the triangles and the mesh ?

1 Like

Yes, the script is a mess atm. I just started learning GH. i know i should have cleaned it up a little before i posted it :sweat_smile:

I also want to point out that the slider at the start of the script will make more lines and points. My idea was to use this for a very detailed way to calculated the mass

OK, first there is a major problem here with this value

The comma separator is used for points, not numbers. So actually you are speciflying the point (0, 75/2 tan(53) , 0) with this panel. It should be 0.75, not 0,75.
Second, angles in GH are in radians, so tan(53) is NOT computed as tan(53°).

Finally, since you project the offset polylines on the mesh, but the height varies, there is no guarantee the angle of the slope will be 53°, is this what you are after ?

Also, dividing a polyline with more points won’t do much since the straight segments will remain straight.

I built a huge triangular Sweep, then split it by the mesh to retrieve the closed volume.

Edit - slightly better version with Sweep1, no need for grafting.

Calculate mass (M3) from lines(updated)_split (23.9 KB)

1 Like

Amazing! and yeah you are right about the angle slope aswell. i was trying to make some calculations to get the bottom to be 1 meter wide and then a 53° angle upwards to the surface. Thank you so much for the help with this! I’ve been struggling a while

1 Like

I have another question for you, lets say if i wanted to put in a pipe like geometry in the “ditch” i’ve created. is it then possible to make the ditch brep form around that pipe? so the volume of the ditch will change according to the radius of the pipe?

You’d need to specify some constraints (what is constant ? slope, depth, width of the bottom ? Maybe keep a tolerance between the pipe and the walls ?), but it should be possible to do that. (17.0 KB)

1 Like

This is a first approximation of the ditch volume. Slider in blue group sets the angle of the sides. (17.4 KB)

DivDist causes several problems as curves are often not evenly divisible by the distance.

1 Like

This is a more accurate model of the ditch and its volume, intersecting the triangular shape with the terrain surface. Wall slope is set to 90 - 53 = 37 degrees from vertical. Using the previous value of 30 (narrower ditch), the volume is ~7% lower with this model: 140,462 cubic units. (34.4 KB)


Thank you so much both of you ! i really appriciate the help! My idea is to try make as little geometry as possible and stil be able to calculate the mass.

I suggest that you replace DivDist with Divide Curve to make sure the ditch is the full length of your base polyline, not shorter.

1 Like

This is an odd question… What about depth of the ditch? If your base polyline were the centerline of a pipe, optimal bottom width and depth could be derived, given radius and clearance values. But maybe the pipe needs a constant slope, given a depth at either end? That too can be derived.

Never mind i could just use math nodes to subtract volume of a pipe ( π x (30 cm)^2 x 486 m ) from the total mass :slight_smile:

I’m still struggling to create a wireframe to calculate the mass from. My plan is to use this to analyze the mass, etc. Maybe one of you can guide me a little on this? I’ve tidied up the script this time. :stuck_out_tongue: its stil the same rhino model as before.
Wireframe Ditch (17.7 KB)

Why are we looking at this again? The volume of the ditch was given by yesterday’s work.

I see you are still using DivDist instead ofDivide Curve. :frowning:

Plan is to calculate m3 from wireframe without creating solid

Why? :man_facepalming:

Why? What does Galapagos do for you? And what happened to @Gennex ?