Hello everyone,
Here is my problem: I need to programmatically create a line starting from 2 vertices that create another vertex for every edge it encounters.
Something like this:
I know that I can use the multi-cut tool (and it’s was I did for the image) but I find that I can’t (or at least I don’t know how) reproduce the same procedure in a script. I saw that Maya uses polyCut command, but to use it you must know all the edges (and where) that the line I would like to draw will intersecate.
The tricky part here is figuring out your frame of reference: Is this coming from an object in the scene? Is it simulating a projection operation performed by the user? or is it similar to drawing a curve on surface? The right answer depends on the circumstances
[QUOTE=Theodox;28074]The tricky part here is figuring out your frame of reference: Is this coming from an object in the scene? Is it simulating a projection operation performed by the user? or is it similar to drawing a curve on surface? The right answer depends on the circumstances[/QUOTE]
Thank you for the reply! In my case I use OpenMaya.MItMeshEdge to iterate over all edges of the Mesh until i find the 2 vertices I am looking for.
Starting from those vertices (for what I know) I can access only their position and their linked edges. Starting from those informations I’d like to create a direct path like in the photo that I posted. Did i replied to you question?
Thank you! It’s definitely what I was looking for! Just a little problem (it’s probably a simple thing that I am missing), when I use “project line on mesh” the projection doesn’t stop on the first surface it encounters, instead the line is projected on all polygon’s surfaces that the projection encounters, an example:
Is there a way to stop the projection at the first surface encountered?
If you do it in two steps, you can just remove the curve segments you don’t want… I think
The polyProjectCurve node knows which face each of the points it created lives on (http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/Nodes/polyProjectCurve.html) You would use that to get the normals and then split the curve-on-poly into lots of segments, removing the segments facing away from the projection direction. If that works, you should then be able to use the split-mesh-with-projected-curve tool to actually add edges to the mesh
’