<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get the direction of an edge? in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12879564#M793</link>
    <description>&lt;P&gt;I'm using 3ds Max's `meshop.divideEdge` to split an edge, and the split ratio comes from calculating the edge's vector. This vector is determined by the two points A and B obtained via `meshop.getVertsFromEdge`. Therefore, the ratio I calculate matches the direction from A to B. However, since `getVertsFromEdge` returns a BitArray, the vertex IDs are always in ascending order. But the `divideEdge` method seems to use an edge direction that I can't determine to calculate the split position, which results in the `divideEdge` position being different from what I expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, I believe that only by knowing the true direction of the edge can I make the `divideEdge` function work as expected.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 05:27:07 GMT</pubDate>
    <dc:creator>futengda</dc:creator>
    <dc:date>2024-07-05T05:27:07Z</dc:date>
    <item>
      <title>How to get the direction of an edge?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12879564#M793</link>
      <description>&lt;P&gt;I'm using 3ds Max's `meshop.divideEdge` to split an edge, and the split ratio comes from calculating the edge's vector. This vector is determined by the two points A and B obtained via `meshop.getVertsFromEdge`. Therefore, the ratio I calculate matches the direction from A to B. However, since `getVertsFromEdge` returns a BitArray, the vertex IDs are always in ascending order. But the `divideEdge` method seems to use an edge direction that I can't determine to calculate the split position, which results in the `divideEdge` position being different from what I expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, I believe that only by knowing the true direction of the edge can I make the `divideEdge` function work as expected.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 05:27:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12879564#M793</guid>
      <dc:creator>futengda</dc:creator>
      <dc:date>2024-07-05T05:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the direction of an edge?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12879698#M794</link>
      <description>&lt;P&gt;you need edge vertices in the direction order:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;/*

--&amp;gt; get face index by edge index:
face = (edge - 1) / 3 + 1

--&amp;gt; get edge index in face:
n = (mod (edge - 1) 3) + 1

*/

-- get edge verts:

fn getMeshEdgeOrderedVerts mesh edge = 
(	
	face = (edge - 1) / 3 + 1
	n = (mod (edge - 1) 3) + 1

	face_verts = getface mesh face
	edge_verts = case n of
	(
			1: [face_verts[1], face_verts[2]] 
			2: [face_verts[2], face_verts[3]] 
	  default: [face_verts[3], face_verts[1]]
	)
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Jul 2024 06:57:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12879698#M794</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-05T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the direction of an edge?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12887935#M795</link>
      <description>you are awesome!</description>
      <pubDate>Wed, 10 Jul 2024 01:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-get-the-direction-of-an-edge/m-p/12887935#M795</guid>
      <dc:creator>futengda</dc:creator>
      <dc:date>2024-07-10T01:29:26Z</dc:date>
    </item>
  </channel>
</rss>

