Surface Optimization

SPASE_1976

Addon Developer
Addon Developer
Joined
May 10, 2008
Messages
137
Reaction score
0
Points
0



ok while i am thinking how to do it any idea or link on how to
make an optimization of n height entries to a x number of points ?

the pic has a coarse example of an optimization to 12 points (or dots)
(points are not at fixed positions )
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,614
Reaction score
2,335
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
The best I know is a greedy algorithm, using the height error for inserting points. But how to do it, would depend on what you are planning to do?

EDIT: OK, you plan to do it in 2D.

Then just select the left most and the right most altitude from the profile and put two points at them. Connect the points by a line.

Now, repeat the following steps until you have 12 points:

1. Select the x-position where the distance between height profile and the existing line(s) is maximal.
2. Split the line at this x-position and insert a new point, with the y-coordinate being the altitude from the height profile.

EDIT: Here is a quick and dirty example as attachment
 

Attachments

  • HeightOptExample.png
    HeightOptExample.png
    49.5 KB · Views: 21

David

Donator
Donator
Joined
Apr 14, 2008
Messages
137
Reaction score
0
Points
0
If you have the coordinates of a limited number of points, and you want to join them with a smooth curve, an algorithm that can do that, is a cubic spline interpolation. This is what Excel uses in its scatter plots, to create a smooth line, joining data points. You can find cubic spline interpolation programs, online, that will do the job of creating new, interpolated points to any resolution/interval.

Basically, the idea is that you give it your set of (x,y) data points, and then you give it an x-value, and the program calculates an interpolated y-value, for you.
 

SPASE_1976

Addon Developer
Addon Developer
Joined
May 10, 2008
Messages
137
Reaction score
0
Points
0
@Urwumpe
in your scetch
1 select the left - right edges // got it
2 get the max and split // got it
3 ? you pick the left line to split to...?? minimum ? average minimum ? leftmost minimum ? (of that left section we split at step 2)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,614
Reaction score
2,335
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
For each line you have, you calculate the maximum height error (distance between line and height profile) and the position where it happens.

Then you select the line with the biggest height error and split the line at the location of the maximum height error. And set the height of the new point to the height profile.
 

SPASE_1976

Addon Developer
Addon Developer
Joined
May 10, 2008
Messages
137
Reaction score
0
Points
0
EUREKA
first we spit the entries to x-2 (-2 edges )

now we get the max min and average and...

(also i want the dots not to move to far away from each other cz the "land "is actually curved to circle)

attachmentid=1562&stc=1&d=1224935977
 
Last edited:
Top