pb_CSG
pb_CSG copied to clipboard
Subtraction with a Plane does not work properly
Is it possible to make a hole in a Plane? Unfortunately, the subtraction doesn't work properly in this case.
Is there a solution how I can get a hole in a Plane?
GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
plane.transform.localScale = Vector3.one * 2;
CSG_Model result = Boolean.Subtract(plane, cube);
GameObject composite = new GameObject();
composite.AddComponent<MeshFilter>().sharedMesh = result.mesh;
composite.AddComponent<MeshRenderer>().sharedMaterials = result.materials.ToArray();
Destroy(plane);
Destroy(cube);

Did you ever find a fix to this?
I would like to cut a plane and having some issues too
Thanks in advance