필터 지우기
필터 지우기

Create surface consisting of two implicitly surfaces

조회 수: 3 (최근 30일)
Fabian Günther
Fabian Günther 2020년 8월 11일
댓글: Fabian Günther 2020년 8월 11일
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

채택된 답변

Bruno Luong
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.
  댓글 수: 1
Fabian Günther
Fabian Günther 2020년 8월 11일
Wonderful, your proposal works exactly as I imagined it would.
It was not clear to me that I can unite the two surfaces by multiplying them.
Thanks alot Mr. Luong.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scalar Volume Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by