
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to develop a script to get shapes constrained to meshsurface.
Much like Shape:Freehand:Constrain works but for linetool, as i need more precision in my line of work than freehand offers.
I'm getting an error with IntersectRay function,where more and more rays get undefined the farther away in z you move the meshsurface. I probably misunderstood how to use IntersectRay in some way.
I also don't know how to use the rays i get in output. They seem a bit off in precision if the first index is supposed to be points in intersection?.
Code:
macroscript MovePointToSurface category: "Testscripts"
(
--create a spline to be projected. Name it Line001
--create a mesh with normals facing spline. name it Plane001
for i = 1 to (numKnots $Line001 1) do
(
local raySP = (getKnotPoint $Line001 1 i)
local rayEP = raySP + [0,0,10000]
local tempray = (ray raySP rayEP)
hits = intersectRay $Plane001 tempray
print hits
)
Thanks in advance
/Fred
Solved! Go to Solution.