Create surface consisting of two implicitly surfaces
    3 views (last 30 days)
  
       Show older comments
    
    Fabian Günther
 on 11 Aug 2020
  
    
    
    
    
    Commented: Fabian Günther
 on 11 Aug 2020
            Dear Community,
I would like to create surfaces consisting of two implicitly described surfaces (see figure).
With the functions isosurface and isocaps I only manage to create a full body (see figure).
So far, I have to create two separate full bodies and then subtract them in another program by boolean subtract. Unfortunately, this route is complex and only works to a limited extent. Therefore, I would like to be able to use Matlab to create the surface limited by two implicit surfaces and the edge surfaces.
To create the stl-files I use as code (Note: This requires the stlwrite.m function):
clc
clear
close all
n=200;
t=pi/n;
x_max=1;
y_max=1;
z_max=1;
xi = 0:t:x_max;
yi = 0:t:y_max;
zi = 0:t:z_max;
[x,y,z] = meshgrid(xi,yi,zi);
F=-1.*(cos(2.*pi.*x)+cos(2.*pi.*y)+cos(2.*pi.*z))+0;
[fs,v]=isosurface(x,y,z,F,0);
[fc,v2,c] = isocaps(x,y,z,F,0);
fn = [fs ; fc+length(v(:,1))];
vn = [v ; v2];
stlwrite('geometry.stl',fn,vn);
Can anyone help me with this question?
Thank you very much and best regards
0 Comments
Accepted Answer
  Bruno Luong
      
      
 on 11 Aug 2020
        "Can anyone help me with this question?"
Not clear to me what exactly is the question.
If you have two implicit equations for two surfaces F1==c1 and F2==c2, you might combine the surfaces of both by
(F1-c1).*(F2-c2) == 0. 
More Answers (0)
See Also
Categories
				Find more on Volume Visualization in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
