Skip to main content
1-Visitor
July 15, 2021
Solved

slice of a 3D surface

  • July 15, 2021
  • 3 replies
  • 7038 views

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

Best answer by Werner_E

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.

 

3 replies

25-Diamond I
July 15, 2021

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

 

payman1-VisitorAuthor
1-Visitor
July 16, 2021

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.

 

 

 

Werner_E25-Diamond IAnswer
25-Diamond I
July 17, 2021

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.

 

ttokoro
21-Topaz I
21-Topaz I
July 16, 2021

image.png

Prime 7

t.t.
payman1-VisitorAuthor
1-Visitor
July 17, 2021

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.

ttokoro
21-Topaz I
21-Topaz I
July 17, 2021

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

t.t.
ttokoro
21-Topaz I
21-Topaz I
July 17, 2021

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

t.t.
ttokoro
21-Topaz I
21-Topaz I
July 20, 2021

ttokoro_0-1626821619313.png

ttokoro_1-1626821668216.png

ttokoro_3-1626821815938.png

ttokoro_4-1626821861792.png

 

 

 

image.pngimage.png

t.t.