Surface area of a convex hull in 3D - cgal

Trying to calculate the surface area of a convex hull in 3D, using CGAL. I have looked at the user manual (http://doc.cgal.org/latest/Convex_hull_3/index.html#Chapter_3D_Convex_Hulls) and have not found any material covering this. I have tried to use polygon_area_2d to calculate the area of the convex hull facets, but have not been successful. Has anybody successfully calculated the area of a 3D convex hull/any suggestions?

Using this example, you compute a triangulation of the convex hull. Them iterating over all the facets of the polyhedron, you can compute the area of each triangle and get the result.
See also this function

Related

how to find the equation of 3d surface by using its coordinates?

Is there any way to find the equation of a surface by using (x,y,y) coordinates? I have all coordinates of a BELL shape surface but not sure if i can estimate the equation of it as a function f(x,y,z).

How to automatically tessellate a triangle's edge at T-vertices

My 3D mesh contains T-vertices. I want to keep all vertices, but automatically subdivide triangles's edges that run through/past such a vertex.
Here's an
image showing triangles with t-vertices, and after the tessellation
that I'm looking for.
I started implementing some code but really think this must already exist.
The question is if your input mesh consist on plain triangles (in which case you can't have neighbors, because you can have several neighbors by each edge) or your mesh consist on "triangle shaped polygons".
If your input are triangles, meshlab won't solve your problem.
If you have polygons, you can use the "convert mesh into pure triangles" filter.

Make conforming Delaunay - Wrong (?) points inserted

I'm using CGAL 2D Delaunay triangulation to define a terrain. I can't use the terrain class because my triangulation has constraints and they can't be used on terrain or 3D triangulations. (That's what I see so far, since there are no terrain properties or 3D triangulation classes). Due to the constraints I'm using the make_conforming_delaunay_2 function to refine the triangulation. I have a problem when using this function. Everything is compiling and running OK, but the problem is with the results:
The function is inserting some points out of any existing triangle face. Is this correct?
Since it is a terrain I need the elevation of these inserted points. Is there any way to make CGAL tell me what triangle face these inserted points are in, so that I could calculate its elevation? I expected the points only in existing triangles faces.
Is there anyway even in a 2d triangulation to use 3D points? (So that the interpolated points will come with the elevation already calculated.)
You can use the class CGAL::Projection_traits_xy_3 like in this example.

How to build a smart bezier curve?

Demo Image : http://i.picpar.com/bzH.png
I want to build a smart bezier curve like this. There are 100 targets (grid) in the map. I know the source point (Rocket), and the target point (Grid). How to calculate two control points to build a beautiful bezier curve which can not across the blue map?
Find curve bounding box and then check if it is contained in blue map rectangle. If it will be outside move control points respectively.
Assuming that you are using cubic Bezier curve (4 control points) for first try You might set some default coordinates of curve control points:
P1(p0.x-10,p0.y+10)
P2(p3.x-10,p3.y+10)
I do not know what language/libraries You are using but it might have Rectangle.Contains(Bezier.BoundingBox) function which might make things easier.

Creating seamless worldmaps with Fractal Brownian Motion

I'm creating heightmaps using Fractal Brownian Motion. I'm then coloring it based on the heights and mapping it to a sphere. My problem is that the heightmap doesn't wrap seamlessly. I've used the Diamond Square algorithm and it's pretty easy to make things seamless using it, but I can't seem to figure out how to do it with fBm and I seem to be having trouble finding an explanation for it on the web.
To clarify, by "seamless", I mean that when I map it to a sphere, it creates a seamless map on the sphere.
Instead of calculating the heightmap per pixel on the heightmap, calculate the heightmap in 3D space based on each point on the sphere and then map that to an image pixel. You're going to have trouble wrapping a 2D, rectangular heightmap like that onto a sphere without getting ugly results at the poles unless you start your calculations from the sphere.
fBM generalizes to 3 dimensions, so given a point on the sphere you can get the height at that point, and then you can do the math to map that value to where it should be stored in the heightmap image.
Or you could use one of the traditional map projections. A cylindrical projection (x, y)->(x, sin y) would give you a seam of just one meridian, which you could rotate to the back. Or you could "antialias" the edge by one or another means.
With a stereographic projection (x,y,z)->(x/(z+1),y/(z+1)), there's only one sour point (the projection point itself).