Mesh connectivity in DHART #55
Replies: 1 comment 7 replies
-
If I understand correctly, I think there are a few things: Its a geometry problem more than raytracing, but I guess you are thinking of it like the projection of rays being verts/handles of a spline, and then interpolating between them. I'm not sure the speed you are dealing with in rhino, but the easiest way (as-is) would be to keep track of triangle centerpoints (e.g. hashtable), and pass to embree as the origin direction and the ray as inverse of the projection (same method as shadow rays). add a bvh mesh of your projection curve (as a mesh). select your triangles based on the ones where the hitid is the mesh id you added. (no need for using primid since you track the triangles in c#). Or..... you might want to consider using the nanort (double precision) raytracer if you continue down this route. Besides being more accurate, the entire bvh code is exposed and pretty easy to understand. Its not as fast as embree, but its pretty close (especially with multiprocessing). Alot (all?) of this will need to be written as new methods in C++ with a new c interface.
Need to define:
i'm pretty sure the patching of the mesh isn't possible with embree. So I guess you would do that in rhino? Otherwise, there is a longer topic to be had for adding mesh utilities to dhart, but it is possible. The API was setup to be modular, which is why when you build it there are a bunch of folders like "spatialstructure" and "graphgenerator", each with their own cmake. We could add another component called "mesh" and build it almost separately from the other packages. It would be the c api that users pass a bvh to and the mesh does its thing. There is one thing I did want to add related to mesh operations, so if you could do the heavy lifting I could help out on the structure. |
Beta Was this translation helpful? Give feedback.
-
In my Rhino plugin, there is an option to modify a mesh with a closed curve with defined cut/fill slopes. Here it is in action:
https://www.youtube.com/watch?v=ySkuNJ6hWUI&list=PLaDqvGFC61g2Nlr58WhOtjv9C-9U5t5qY&index=11
Key concepts:
Currently I'm traversing a Rhino.Mesh and use its connectivity information. Inspired by our exchange so far and experience with the Embree Raytracer I'm considering transitioning towards Embree's BVHs completely.
Is there a way to perform operations from point 3 within a BVH structure? Ideally, I'd like to identify which triangles intersect with a polyline projected to the mesh AND find all triangles which are within the bounds of the polyline. Geometrically, you could imagine a solid extrusion of the line, which deletes all the faces it intersects:
Beta Was this translation helpful? Give feedback.
All reactions