Create surface consisting of two implicitly surfaces
조회 수: 3 (최근 30일)
이전 댓글 표시
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
채택된 답변
Bruno Luong
2020년 8월 11일
"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.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!