I have a polygon mesh defining a valid inner region and a point outside of this polygon mesh. From this point i want to find the closest point on the surface on my polygon mesh.
I have no background in computational geometry and don't know the buzzwords. How can i achieve this using cgal or any other library in C++?
You might have a look at the Location Functions in CGAL.
Related
I need to check if a point given as x,y,z coordinates is within an extruded 2.5D Polygon. I thought it should be possible to achieve using a 2D point-in-polygon check (e.g. [1]) with additional distance checks.
I'd like to avoid creating meshes for the polygon for performance reasons. Is it possible?
[1] How can I determine whether a 2D Point is within a Polygon?
Does anyone know an algorithm to generate a 3d surface mesh given a set of vertices? My project requires that we construct an irregular 3d object in OpenGL and I am having trouble finding out how to do this using triangulation.
You better with a library like cgal. It implements the boywer-watson algorithm but with tetrahedrons. It's a very fast incremental triangulation. Then find the convex hull and remove edges exceeding alpha.
I am looking for a accurate polygon offset algorithm for 3D polygons, convex and non convex. This can also be achieved with Minkowski sum with a sphere. I know CGAL provide a minkowski package.
However, is there an easy algorithm that I can implement to achieve this task of polygon offse in 3D.
Thanks.
Cheers,
CB
There are easy-ish approaches for offsetting convex polyhedra -- you just move each polygon along its normal, convert edges into cylindrical arcs, and vertices into spherical sectors. For concave geometry, though, this will produce intersecting and degenerate faces. If all you want to do is render then that's okay... but if you intend to do anything interesting with the offset geometry, you really need the big guns provided by things like CGAL.
I have a few planes (3-10 of them) in 3d defined by their equations (three coefficients and the offset). These planes are the edges of a convex polyhedron. I need to draw that polyhedron. How can I do that? What software/libraries/algorithms can I use? I work in Linux and I'm usually using C or C++.
Every plane pair intersects in a line on both planes. Each plane then contains a set of lines that intersect in points, all of those are the edge points of your polyhedron you'll have to connect in a convex way.
With some math/geometry skills, you should be able to solve this, but using a library (f.e. CGAL) of course simplifies it and prevent you from reinventing the wheel.
This polygon could be shaped like a C
I tried the formula located here
How can I determine whether a 2D Point is within a Polygon?
however it doesn't actually correctly predict if the point is in the polygon.
Easiest way - especially for lots of points is to triangulate the polygon then do a point in triangle test.
You could convert the polygon into a set of convex polygons but that is trickier.
See also Random points inside a 4-sided Polygon