Background
In RealtimeCSG, brushes (convex meshes) are represented using the half-edge data structure (see here).
At the moment we convert all of the polygons of a generated convex mesh into planes and then feed those into a RealtimeCSG function that converts a set of planes into a brush. But converting planes (finding the intersection point of 3 planes, where sometimes there are infinite intersections) into a convex mesh is a difficult problem. That's why it often fails and has stability problems.
Your task
Build a function that can take a PolygonMesh (see here) and build a brush in the scene, by calling
BrushFactory.CreateBrush (see here). This requires generating the half-edge connectivity data.
Files
The C# function has been prepared and only needs contents. Here is a special version of the 2D Shape Editor that you can add as a package:
com.aeternumgames.shapeeditor.zip
Here is the Bounty.cs file, place this file in your RealtimeCSG installation (in your Assets directory):
RealtimeCSGBounty.zip
Try extruding using "RealtimeCSG -> Create Bevel" and you will get a notification in the console window that leads you to the function that needs to be written.
public static CSGBrush CreateBrushFromPolygonMesh(Transform parent, string brushName, PolygonMesh mesh)
{
var controlMesh = new ControlMesh();
var shape = new Shape();
Debug.Log("Bounty code goes here! Thank you! <3");
return BrushFactory.CreateBrush(parent, brushName, controlMesh, shape);
}
Tips
- A
PolygonMesh is just a List of Polygon. They are convex n-gons (no triangulation) without duplicate normals.
- The payment of 50$ (or 50€ if preferred) will be made via PayPal after verifying your work.
Background
In RealtimeCSG, brushes (convex meshes) are represented using the half-edge data structure (see here).
At the moment we convert all of the polygons of a generated convex mesh into planes and then feed those into a RealtimeCSG function that converts a set of planes into a brush. But converting planes (finding the intersection point of 3 planes, where sometimes there are infinite intersections) into a convex mesh is a difficult problem. That's why it often fails and has stability problems.
Your task
Build a function that can take a
PolygonMesh(see here) and build a brush in the scene, by callingBrushFactory.CreateBrush(see here). This requires generating the half-edge connectivity data.Files
The C# function has been prepared and only needs contents. Here is a special version of the 2D Shape Editor that you can add as a package:
com.aeternumgames.shapeeditor.zip
Here is the Bounty.cs file, place this file in your RealtimeCSG installation (in your Assets directory):
RealtimeCSGBounty.zip
Try extruding using "RealtimeCSG -> Create Bevel" and you will get a notification in the console window that leads you to the function that needs to be written.
Tips
PolygonMeshis just aListofPolygon. They are convex n-gons (no triangulation) without duplicate normals.