In a similar way to how hatch, or planarsrf is able to do boolean operations, is it possible to rebuild this mesh using these three parts, the Delaunay component, and not fill in the hole?
I think i see green lines in your path that are not yet part of your mesh, so you would need to make sure they are created with the rest of the mesh. For this check out this tutorial: https://www.youtube.com/watch?v=auTzooRfyYI
For cutting the mesh with lines, check out this discussion:
Not sure which exact file you can best use there, but i have a working C# or Python script somewhere.
Hi Martin, thanks for your reply.
Ideally, it must be a mesh. I am working with landscapes which are around 220 hectares, and simple joined meshes with many many faces seems to be the only way to work. The mesh on top is purely for albedo. The other option is to project a high resolution image onto the mesh for colour, but that is problematic as well.
If this were rendered in Unreal Engine, it might be able to reduce the mesh dynamically to what’s in the view.
I digress, the colour albedo path needs to be projected perfectly on the landscape mesh; hence using the same edges as what’s underneath. If I create a new mesh based purely on the path, and no the underlying landscape, the edges dont match. When I project that flat path to the underlying landscape, parts intersect and become ugly/unpure.
I’m not sure I understand your comment. The green lines were gathered in this manner. First, I made the underlying landscape mesh. Second, i extracted the edges of the whole of the landscape mesh. Third, I trimmed all those curves with the boundary of that path hatch. That’s how I got those green lines.
Due to the nature of the workflow to generate the landscape, the path and other landscape elements which form the mesh are not formed separately and joined; they are formed as one mesh from the start.
The addition of colour is purely for communication on that 3d mesh. I need to have distinct colour for different landscape elements that can seamlessly ‘sit’ on the underlying landscape mesh. Not sure if it’s possible or not.
Ok, that makes it easier. If you can find exactly the outlines / naked edges of your shape, you should be able to cut out the path using the following Python script.
"""
Split mesh (M) at polyline (PL)
Author: Anders Holden Deleuran
"""
import Rhino as rc
# Weld mesh
M.Weld(rc.RhinoMath.ToRadians(180))
# Get topological edges midpoints
teMids = rc.Collections.Point3dList()
for i in range(M.TopologyEdges.Count):
teMids.Add(M.TopologyEdges.EdgeLine(i).PointAt(0.5))
# Get topological edges to unweld
teUnweld = []
for polyline in PL:
segments = polyline.GetSegments()
print len(segments)
for segment in segments:
teUnweld.append(teMids.ClosestIndex(segment.PointAt(0.5)))
# Unweld mesh and explode it
M.UnweldEdge(teUnweld,True)
M = M.ExplodeAtUnweldedEdges()
But i imagine you can also just find the faces you want to delete from your mesh using their centroids and your path shape connected to a Inside Shape component or sth. If you upload your file with all geometry internalized i can see if i can help you further.
You need to make an input called M and PL on the grasshopper component and then feed the mesh to cut into M and the path boundary Polyline into the PL input.
You are getting a None Type error because you have nothing connected/plugged into your script component inputs so the script is saying “hey sorry I can’t weld something that is nothing”
Typically components have logic inside them to bypass this error and say “no input found in M” or something like “please provide a mesh”
But this is a leaner script and doesn’t have robust error handling in that way which is fine.
You should now just reference your mesh in Grasshopper and plug the wire from that Mesh into your M input of the script component. Likewise, plug the polyline boundary into your PL input.
See how the original linked post has the mesh node connecting to the M input and the “Curve” node connecting into the PL input?
I’m trying to use the trimmed edges of the mesh to generate a new mesh limited to the bounds of the curve, but without mesh in the area indicated by the red x in the image below
Below is a version which uses curves as input instead of the meshes from the previous thread. Note, the outer boundary needs to be the first curve in the list. 20240914_SplitMeshAtPolyline_BW.gh (10.8 KB)
All that I’ve learned about C# coding is by just doing. There has been a lot of trial and error and I still see myself as a hack, but this forum (for RH specific code) and StackOverflow (for the basics) have served as some fantastic resources with plenty of great examples to learn from. With AI, I expect my path would have been different.