How to use Delaunay Triangulation to create a plane with constraints?

조회 수: 11 (최근 30일)
youssef hany
youssef hany 2022년 11월 2일
답변: Jeffrey Clark 2022년 11월 8일
I have four coplanar points shown in red and I want to create a plane bounded by these four points (representing a wall). The green points represent constraints in the wall that I want to be empty in the plane. I want to use Delaunay Triangulation do that but it fails because points are coplanar. what should I do?
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 11월 2일
It is not clear what "create a plane" means to you ?
You might be interested in some of the functions from the PDE Toolbox, as some of them include creating a mesh for an shapes "excluding" particular shapes.
youssef hany
youssef hany 2022년 11월 2일
편집: youssef hany 2022년 11월 2일
I mean a 3D plane surface that can be exported to revit, something like that

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

답변 (1개)

Jeffrey Clark
Jeffrey Clark 2022년 11월 8일
@youssef hany, if all your points are coplanar for one section (in your picture a wall, floor, etc) they can be processed as 2D by dropping the constant dimension and using 2D delaunayTriangulation with constraints for windows, doors (regular and trap). If you are working in arbitrary 3D where coplanar points don't share the same one x, y or z you can rotate each coplanar section to eliminate one dimension using something like:
function Pxy = rotateCoplanar(Pxyz)
Rx = @(t) [ 1 0 0 ...
; 0 cos(t) -sin(t) ...
; 0 sin(t) cos(t) ];
% Ry = @(t) [ cos(t) 0 sin(t) ...
% ; 0 1 0 ...
% ; -sin(t) 0 cos(t) ];
Rz = @(t) [ cos(t) -sin(t) 0 ...
; sin(t) cos(t) 0 ...
; 0 0 1 ];
Pmean = mean(Pxyz,1);
Pnew = Pxyz-Pmean;
uT = cross(Pnew(1,:)-Pnew(3,:),Pnew(2,:)-Pnew(3,:)); uT = uT/norm(uT);
nx = Rz(atan2(uT(1),uT(2)));
uTnx = (nx*uT')';
Pxy = (Rx(atan2(uTnx(2),uTnx(3)))*nx*Pnew')'; Pxy = Pxy(:,1:2);
end

카테고리

Help CenterFile Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by