Vex - Generate @Cd threw intersecting with a mesh

   2101   5   0
User Avatar
Member
48 posts
Joined: 2月 2018
Offline
Hello,
how is it possible to generate @Cd threw intersecting with a mesh?
In the area from the second mesh should be colord points or primitives on the first mesh.

thanks.

Attachments:
example.JPG (87.5 KB)

User Avatar
Member
2048 posts
Joined: 9月 2015
Offline
Keep your eyes peeled for others methods you may like better.

More than one way to do it.

Attachments:
Cd via Bounds.hiplc (69.9 KB)

User Avatar
Member
480 posts
Joined: 7月 2005
Offline
Hi,

“intersect_all” can help you aswell. If you count the number of intersections of a ray in any direction, it should be odd inside and even outside. But sometimes I've ran into numerical problems, if the intersection points are close together. You can minimize this problem by decreasing the tolerance.

Attachments:
InteriorColor.hipnc (74.4 KB)

User Avatar
Member
48 posts
Joined: 2月 2018
Offline
Thank you both very much.
Very instructive.
User Avatar
Member
480 posts
Joined: 7月 2005
Offline
Sure man ,

I just found out, that the ray length has not been calculated correctly, so I've attached a fixed version.

Attachments:
InteriorColorfixed.hipnc (75.7 KB)

User Avatar
Member
37 posts
Joined: 8月 2015
Offline
Volumes would be great for this. It might be more efficient as you can control the sampling of the incoming geo and it should scale really well with geometric complexity.



Simply use a volume sample in a point VOP on the object you want colors on. Pipe in the volume and sample it at the point position.
Edited by Nicolas Longchamps - 2018年5月16日 16:26:18

Attachments:
IntersectVolumeSample.png (1.4 MB)

  • Quick Links