Clear Filters
Clear Filters

3D-plot of "x^2+y^2-z^2=1"

66 views (last 30 days)
Chung-Hao Li
Chung-Hao Li on 15 Feb 2016
Commented: Chen Guo on 20 Apr 2020
Here is my code:
[x,y,z] = meshgrid( linspace( -10, 10, 20 ) );
f = x.^2 + y.^2 - z.^2 ;
isosurface(x, y, z, f, 1);
Question: I need the x, y, z coordinates to feed to SolidWorks to do 3-D printing. How can I do this, please ?
  2 Comments
Image Analyst
Image Analyst on 15 Feb 2016
What kind of data file does SolidWorks like? A CSV file? A binary file? How about dlmwrite(), fprintf(), or fwrite()?
Chung-Hao Li
Chung-Hao Li on 18 Feb 2016
XYZ COORDINATE FILES ARE REQUIRED FOR SoidWorks.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Feb 2016
fv = isosurface(x, y, z, f, 1);
returns face and vertex data in the structure fv.

More Answers (1)

Chen Guo
Chen Guo on 19 Apr 2020
Why images are not continuous
  6 Comments
Walter Roberson
Walter Roberson on 20 Apr 2020
f(0,0,0) is 0, not 1 (the isosurface level), so you only get points drawn completing the cones if there are enough points near the origin that happen to have value 1. But when you switch to linspace(-20,20,20), the closest coordinates to the origin are at about -1.05, leaving a gap of about 2.1 between adjacent points. It just isn't enough to fill in the middle with values near 1.
Chen Guo
Chen Guo on 20 Apr 2020
OK, I got it. Thank you very much.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!