pointToPointOnTriangle behavior

Hey Guys,
I’ve come across an issue today when using pointToPointOnTriangle.

Sample code:

basemesh = wrap.Geom(wrap.demoModelsPath + "HeadPolygroups_MakeHuman.obj", scaleFactor=1000)
baryCoord = basemesh.pointToPointOnTriangle(0,0,0)
wrap.selectPoints(basemesh,None,[baryCoord])

The issue is that pointToPointOnTriangle returns a result regardless of the distance from an (X, Y, Z) position. [See attached image]
I’m using this to test determine if a baryCentric point exists at this position. If so then use this point. Otherwise, proceed through.

It would great if you could add some sort of distance tolerance. It could default to none to keep backward compatibility. However if I define a distance tolerance and it fails, throw an exception. This way I can catch the exception and handle it on my end.

So an example might be:


baryCoord = None
basemesh = wrap.Geom(wrap.demoModelsPath + "HeadPolygroups_MakeHuman.obj", scaleFactor=1000)
try:
	# Is there a triangle at this position?
	baryCoord = basemesh.pointToPointOnTriangle(0,0,0, tolerance=1.0)
except:
	# Nope
	print "No triangle found at this position"

if baryCoord:
	wrap.selectPoints(basemesh,None,baryCoord)

Thanks,
-Sean

Hi Sean!

You are right, it’s usable feature. I added this parameter as maxDistance, see the docs here:
http://russian3dscanner.com/docs/WrapX/wrap.Geom.pointToPointOnTriangle.html

Since we are not officially announced 1.3.3 yet, I just replaced file with a new build with this update:
Download it again please:
http://russian3dscanner.com/downloads/R3DS_WrapX_1.3.3_64Bit_Setup.exe
http://russian3dscanner.com/downloads/R3DS_WrapX_1.3.3_64Bit_Setup.exe.md5sum.txt

Awesome guys! Thanks for the quick turn around. I’ll check it out when I get back in the office on Monday. I was looking through the the Docs and the maxDistance addition could be useful for all the projection funtions(pointOnTriangleToPoint and nearestVertexInd).

Thanks again,
Sean

Is this available for all users?

I’m also using the pointonTriangle function and noted
that the Daz un-connected geometry problem is
now treated with an exception at runtime in version
1.3.3.

Can we just install over the previous version and use the
same registration key?

Many thanks in advance.

Yes, you can install it over and use. But it is possible that I will add more tiny fixes before Monday when 1.3.3 will become default version for download.