Notifications
Clear all

[Closed] Connect vertives – clean mesh as a result?

Hi!

What I would like to achieve is to connect the vertices as it is shown in the image below(it is a part of the whole object)

But, no matter if I use ConnectVertices or polyop.CutVert the result is not as expected. 3ds max creates some hidden edges, or the connection(cut) is not performed, or something else is happening.

Sometimes the Subdivide modifier creates proper connections between the verts, but sometimes it also fails to do the job.

Is there a way the verts to be connected as I want?

If someone is interested here is the max file(max2016) and the script I use to connect the verts.

https://drive.google.com/file/d/1Hh1NS1q-E1TFYH_tzmsBgq684scBuVqQ/view?usp=sharing

https://drive.google.com/file/d/1mUxdHQ3-QdHqtu5JNmQQPfIueqGUDmja/view?usp=sharing

11 Replies

cases like this one are especially tricky to solve since they introduce an extra vertex
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

Yes. Cases like that one can be skipped. The polyop.CutVert can solve this, but that connection is not required.
The $.ConnectVertices will not create a connection between the two verts.

Maybe it is worth to discard the triangulation (since re-triangulation doesn’t fix it anyway) and make a new mesh?

code
shp = splineShape()
for i = 1 to $Shape001.numverts do
(	
	addnewspline shp
	
	pt = polyop.getvert $Shape001 i
	addKnot shp i #corner #line pt
	addKnot shp i #corner #line pt
)

updateShape shp
select shp

t = Terrain()
terrainOps.addOperand t shp

Thank you.
Can you show me what mesh is generated in your 3ds max?
Here, max2016, the terrain is not as expected(some of the original edges are missing)

Yes, that’s expected. It didn’t come to my mind at first, but when I downloaded your scene it became clear that it isn’t a solution
You need constrained delaunay if you want to keep arbitrary edges in the resulting triangulation. Terrain object can’t do that kind of thing

it’s a retriangulation issue, don’t think your going to get better than subdivide with a large value… Sweepline is similar can give good and bad results (though streets ahead of max’s built in routines). You may get better results with something custom if you can guarantee axis alignment at all times. Recreating the mesh as with the terrain above is still the same triangulation problem you need to resolve.

Thank you, guys.
More sleepless nights are coming.

I solved a similar problem a while back. This was the rough procedure I used:

  1. identify exterior edges
  2. add those exterior edges to a new shape
  3. weld shape verts
  4. optimize shape by removing verts that lie within a straight segment
  5. check shapes to make sure they’re closed, if not close them
  6. convert to poly, use subdivide with large value for better triangulation

In my case, I also had to identify T-junctions and insert new verts.

Thank you.

Page 1 / 2