geom3d
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations
Author: David Legland

Many thanks David!!!
Nam

08 Nov 2012

geom3d
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations
Author: David Legland

Dear David,

Thanks for your very useful toolbox!

I've used some of your functions and I've found some things :

+ My problem :
I have a 3D point set. I create a minimum convex hull of this point set, using convhulln, so I have a list of facets of the convex hull.

I'd like to clip this convex hull by a plane. And this leads me to your function.

+ There 2 ways to do this with your toolbox :

1/ Use the function clipConvexPolyhedronHP. It works for my problem!
However if we want to have a side of convex hull (below or above to the plane) to clip, we must have a right plane input!!!

For example:
chX = convhulln(Pts); %Pts : 3D point set

% This function createPlane gives me : plane=[0,0,0.7,0,1,0,1,0,0]
% Then the function clipConvexPolyhedronHP returns me a wrong polyhedron. So I permute the 2 direction vectors of the plane : plane=[0,0,0.7,1,0,0,0,1,0] and it returns me a polyhedron with the right side that I desire.

So do you have a tip to use the function createPlane to have a good result (so I dont have to permute the 2 direction vectors of the plane) ?

2/ Use the function polyhedronSlice. It doesn't work because it doesnt return only the intersection points of the plane and the polyhedron, but also some points that are wrong (see the image https://dl.dropbox.com/u/8702546/WEB/image_1.png).

However, if the function works, I can control the side of polyhedron that I want to clip by a simple command of Matlab!

So I feedback you this to correct the function polyhedronSlice!

I dont know if someone has already asked about these things...

@Johannes,
The new set of faces refer to indices of vertices actually used by the faces. So it is necessary to use the following syntax:
[V2 F2] = mergeCoplanarFaces(vertices, K);
drawMesh(V2, F2);
The demo file is somewhat outdated, I will update it, and fix the doc of the mergeCoplanarFaces function.
Concerning the tolerance value, it is used for comparing normalised normal vectors of planes containing faces. There can be some numerical issues, but using 1e-4 should be fine.
regards,
David

Comment only

16 Jun 2014

geom3d
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations

Hi Chien Ting,
thanks, this is fixed! Yes, if you have any more updates, I an include them. Do not hesitate to contact me by email (on my author page)
regards,
David

Comment only

03 Jun 2014

geom3d
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations

I've been using your toolboxes for years, thanks for some great tools.
In drawEdge3d.m, line 29, I believe is a bug, it would never get executed. The correct line might be:
elseif nargin >= 6;
Also I've complete the documentation of drawEdge3d.m for my group's use. If you want see/use my version, let me know!
Thanks for some great tools!

Comment only