public void CreateCoreBrushMeshFromControlMesh()
    {
        ControlMesh controlMesh;
        Shape       shape;

        BrushFactory.CreateCubeControlMesh(out controlMesh, out shape, Vector3.one);
        BrushMesh brushMesh = RealtimeCSG.Legacy.BrushFactory.GenerateFromControlMesh(controlMesh, shape);

        BrushMeshInstance coreBrushMesh = BrushMeshInstance.Create(brushMesh);

        Assert.AreEqual(true, coreBrushMesh.Valid);
    }
    static BrushMeshInstance CreateCube(Vector3 size, CSGOperationType operation = CSGOperationType.Additive, Material material = null)
    {
        if (material == null)
        {
            material = material2;
        }
        ControlMesh controlMesh;
        Shape       shape;

        BrushFactory.CreateCubeControlMesh(out controlMesh, out shape, size, material);
        BrushMesh brushMesh = RealtimeCSG.Legacy.BrushFactory.GenerateFromControlMesh(controlMesh, shape);

        return(BrushMeshInstance.Create(brushMesh));
    }
    public void CreateBrushMeshFromControlMesh()
    {
        ControlMesh controlMesh;
        Shape       shape;

        BrushFactory.CreateCubeControlMesh(out controlMesh, out shape, Vector3.one);

        BrushMesh brushMesh = RealtimeCSG.Legacy.BrushFactory.GenerateFromControlMesh(controlMesh, shape);

        Assert.AreNotEqual(null, brushMesh);
        Assert.AreNotEqual(null, brushMesh.vertices);
        Assert.AreNotEqual(null, brushMesh.halfEdges);
        Assert.AreNotEqual(null, brushMesh.polygons);
        Assert.AreEqual(8, brushMesh.vertices.Length);
        Assert.AreEqual(24, brushMesh.halfEdges.Length);
        Assert.AreEqual(6, brushMesh.polygons.Length);
    }