Skip to main content
1-Visitor
Jul 15, 2021 9:51 AM UTC
Solved

slice of a 3D surface

Hello everyone,

The data points of a 3D surface are supplied in the accompanying worksheet. I'm looking for a slice of the surface at any azimuth angle. Through interpolation, I was able to extract the function that describes the surface. The function slice(phi) was subsequently constructed to slice the surface at any angle phi. Due to missing points on the original data on the rim, the interpolated function shows irrational behavior around the edges (except at zero and half-pi angle). In this example, the rim is a circle of diameter of 15.8.

 

What are your recommendations for dealing with this issue?

 

I am grateful for your aid.
Best,
Payman

Werner_E
Werner_EAnswer
25-Diamond I
Jul 17, 2021 4:25 PM UTC

Here is a further attempt of mine. This time I scan through the data in x-direction and replace the outer zero values by the linear interpolated (extrapolation actually) using only the non-zero values. Its still not perfect, but I guess its better than the first attempt.

 

I still think that, assuming we really have to deal with a quadric, a fit of an appropriate function might be the better approach.

If its not a quadric but rather just a similarly looking arbitrary surface, you'll have to stick with the data and its interpolations, of course.

 

13 replies

Werner_E
25-Diamond I
Jul 15, 2021 10:44 AM UTC

I guess the problem is the abrupt jump of the data at the rim from the paraboloid(?) surface down to the zero ground in combination with the spline interpolation which tends to overshoot in such cases .

It looks like linear interpolation does a better job:

Werner_E_2-1626346229326.png

 

(changed "slice" so that the angle with the correct  unit degree can be used)

The artefact you still see could be avoided by making the value of "edge" slightly smaller, if thats appropriate.

BTW, if you know that the surface should be a paraboloid, you could try fitting an appropriate function instead of an interpolation.

MC15 sheet attached

 

Translate
payman1-VisitorAuthor
1-Visitor
Jul 16, 2021 9:55 PM UTC

Thank you for your suggestions, Werner E.

linterp, as you indicated, helped to improve the issue. I wrote a piece of code to replace the zeros on the surrounding area with NaN. As a result, the outliers are now removed, but the margins of the slices are missing. I know the edges must end up in -3.7 in this example, but I couldn't add it manually.

It's worth mentioning that when I tested spline and fitting algorithms with data that contained NaN, they failed.

 

Thank you,

Payman.

 

 

 

Translate
Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
Jul 17, 2021 4:25 PM UTC

Here is a further attempt of mine. This time I scan through the data in x-direction and replace the outer zero values by the linear interpolated (extrapolation actually) using only the non-zero values. Its still not perfect, but I guess its better than the first attempt.

 

I still think that, assuming we really have to deal with a quadric, a fit of an appropriate function might be the better approach.

If its not a quadric but rather just a similarly looking arbitrary surface, you'll have to stick with the data and its interpolations, of course.

 

Translate
ttokoro
21-Topaz I
Jul 16, 2021 11:37 PM UTC

image.png

Prime 7

Translate
t.t.
payman1-VisitorAuthor
1-Visitor
Jul 17, 2021 5:32 AM UTC

Thank you very much ttokoro; It looks great.
Is it possible to provide a quick description of the procedure or post the worksheet?

 

best,

Payman.

Translate
ttokoro
21-Topaz I
Jul 17, 2021 6:56 AM UTC

Just add yellow programs to WE's sheet and converted to Prime 7 format.

Translate
t.t.
ttokoro
21-Topaz I
Jul 17, 2021 11:34 PM UTC

Slice of sphere by projection of circle and alpha. 🙂

Solved: two straight lines projection on a sphere - PTC Community (WE's post for MFra is modified.) 

 

image.png

Translate
t.t.
ttokoro
21-Topaz I
Jul 20, 2021 7:16 AM UTC

ttokoro_0-1626821619313.png

ttokoro_1-1626821668216.png

ttokoro_3-1626821815938.png

ttokoro_4-1626821861792.png

 

 

 

image.pngimage.png

Translate
t.t.