Why does this happen! Delaunay mesh troubles

unhandled

#1

I cannot figure this out for the life of me. I feel like I’ve tried everything. When I’m creating topographies using the Delaunay mesh in, if there are very steep aspects to the terrain, the triangulation goes all wonky at the bottom and top. I’ve tried increasing points, decreasing points, doing the whole mesh in pieces, lofting then meshing…the list goes on.

Can anyone tell me what exactly is causing this or why it happens so I can figure out a way around it?


(Pfotiad0) #2

You haven’t attached anything (don’t do that) but IF your goal is to do a Delauney mesh out of points that are NOT “as planar as possible” (meaning that the more your collection deviates from that rule the more the results may be bananas) … you date the wrong girl.

Try some ball pivot approach.


(Menno Deij - van Rijswijk) #3

There are large differences in distance between the points on the red/pink curves; ball-pivot may not work so great either.


#4

Ah, I didn’t attach anything cause I was hoping it was a simple problem people good diagnose just from the screen grab…

I took a quick snippet of the curves I’m working with…bear in mind this is a small portion of a much larger model.

The script isn’t much to look at now because as I said, I’ve been trying things and deleting them for hours now…so this is just basic to get the curves out there.

I was wondering if there was a way of forcing a mesh between two curves only, then combining those strip meshes in a simple way…but when I tried that I was running into similar problems.

MeshTerrain.gh (235.1 KB)


#5

(I’d prefer to use nurbs surfaces, but I’ve got waaaaayyyy to many points to patch)


(Pfotiad0) #6

Not nuclear science via code … but nuclear science with components (having various “general cases” in mind and too many conditions/questions rising).For instance imagine the questions required for a very simple case like this (patch that works when [and if] it works):

Plan Z: If this is a real-life case ask for a proper density LIDAR cloud and then do a proper ball pivot (or demand a mesh as an ouput).

If on the other hand is some Academic case simplify your curves do some patch (good luck) and then “distrot/enchance” the mesh in order to look more “realistic”.


(David Rutten) #7

It may be the right girl, you just need some more foreplay.

Delaunay is indeed a purely 2D algorithm, so distances between points are measured while ignoring the elevation differences. This makes delaunay behave badly for points whose local plane approximation does not align well with the global plane.

However you can always try remapping your points to get a better distribution. In this case, you could try creating a coarse nurbs patch through the landscape. It doesn’t have to be very accurate, as long as it provides a better approximation of the local plane throughout the point set. You then project all the (x,y,z) points into surfaces (u,v) space, and run your Delaunay algorithm on the (u,v) coordinates instead.

You will have to ultimately replace the mesh vertices with the original (x,y,z) coordinates to get a 3D mesh again.


(Pfotiad0) #8

Indeed that’s a good approach (but requires a certain cleaning on the Del mesh [depending on the case] . Maybe - just maybe- a ball pivot on u,v pts could be more appropriate [depending on the case]).

On the other hand … working on an approx mesh (Mesh Machine) and then adding more faces and/or adjusting the existed ones … maybe - just maybe.


#9

Foreplay it was…well almost. Using David’s approach I got it close enough that I can ignore some of the issues for now. I’ll keep picking at it later and probably use the ball pivot method to help clean it up.

Thanks for both of your help.


(Pfotiad0) #10

Well … since Canada F1 goes on afternoon hours maybe I’ll give this a spin with C# this w/e (auto clean Del mesh and/or go for a ball pivot approach and/or go for some other way).

But still the patch (also via C#) for the initial approx surface is very slow (and works when it works not to mention that using some other test curves doesn’t make anything useful at all) to the extend that renders the whole approach more or less non interactive (Imagine some BIG N of curves etc etc),


(Pfotiad0) #11

DISASTER: Lewis said that Mercedes is not ready with the new engine (the trad upgrade). Meaning that he’s going to use a 7 races old thingy in the typical power circuit of Mondreal (Ferrari and Red Bull have new stuff on hand). With this in mind my moral is below zero.

Anyway … get a WIP (no clean Mesh capability) thingy following David’s suggestion… but I think that the path is long (and hilly). C# that does the patch in not supplied (meaning that the surface is provided as well).

Mesh_FromContours.gh (361.3 KB)
Mesh_FromContours.3dm (1.0 MB)


(Wim Dekeyser) #12

No worries! My 2004 Toyota gets me where I need to be - every time.

In this context, hilly is good!

WIP’s fine, final is better. Just keep working :sunny:


(Pfotiad0) #13

Sweet Jesus > RESET > get rid of the pig ugly thing ASAP > mortgage the house > sell kids > get rid of the wife > buy: an all black Ariel Atom with Nitron suspension and Honda power [avoid supercharging it].

The attached is ~25% faster (avoids passing the same stuff N times to a certain Method).

Mesh_FromContours_V1.gh (369.0 KB)


(David Rutten) #14

Or you could be cool like me and get one of these instead of a fuel based transportation device.


#15

Yes, that’s cool. I just bought one some weeks ago (but not as expensive) and I’ve made the forest path’s unsecure ever since. I just got over the worst PITA.

Should have considered buying a model with chock absorbers also in the rear.

// Rolf


(David Rutten) #16

I got mine at a lower price too at the end of the season. I’m hooked now but not sure I would have forked over 2000E back then for a carbon frame.


#17

It’s a lot of fun, really. But yours is half the weight of mine. :open_mouth:

When I become rich I’ll get one of those lightweight models made for lazy people. :face_with_hand_over_mouth:

// Rolf


(Pfotiad0) #18

With all due respect THIS is cool (ideal for IKEA shopping as well):

On more trivial matters:

This (still WIP) is taking your suggestion some steps further … but for a variety of occasions is not the ideal way to cut the mustard.

Mesh_FromContours_V2.gh (140.2 KB)
Mesh_FromContours_V2.3dm (2.5 MB)

Spreads points proportionally to the crvs length (meaning that you need a safety net if small and long coexist [reds are the skipped ones]).

Then it does the quide surface either using a user provided one or one via patch VS pts (in 1 or 2 phases). But patch is very slow (for good reason):

Or a bit off topic:

Then you need to clean the Del mesh:

But even if you do that the result is… still … 1M miles away from some “ïdeal” solution:

Plan B (WIP): “enchance” the contours where is needed (say: do some special kind of mean mini curves), spread proportionally to the length points and use a ball pivot thingy.