Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Subtraction with a Plane does not work properly #15

@pmizel

Description

@pmizel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions