pb_CSG icon indicating copy to clipboard operation
pb_CSG copied to clipboard

Subtraction with a Plane does not work properly

Open pmizel opened this issue 5 years ago • 1 comments

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);

image

pmizel avatar Aug 18 '20 09:08 pmizel

Did you ever find a fix to this?

I would like to cut a plane and having some issues too

Thanks in advance

enumouse avatar Sep 04 '22 10:09 enumouse