We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Holes In Meshes

Hey,

Is it possible to define a mesh with a hole in it?
E.g I create cube1 and cube2, where cube2 is a hole in cube1

I was thinking it might be possible with VertexElementHole, but I could not get it right…

@Hue404

Would you please share a sample code snippet that you are already using to create cubes? We will further proceed to assist you accordingly.

Hello @asad.ali,
I am using the code from your github:

    public static Mesh createMeshUsingCreatePolygons()
    {
        // ExStart:CreateMeshUsingCreatePolygons
        List<Vector4> controlPoints = defineControlPoints();

        // Initialize mesh object
        Mesh mesh = new Mesh();
        // Add control points to the mesh
        mesh.getControlPoints().addAll(controlPoints);
        // Create polygons to mesh
        // Front face (Z+)
        mesh.createPolygon(new int[] { 0, 1, 2, 3 });
        // Right side (X+)
        mesh.createPolygon(new int[] { 1, 5, 6, 2 });
        // Back face (Z-)
        mesh.createPolygon(new int[] { 5, 4, 7, 6 });
        // Left side (X-)
        mesh.createPolygon(new int[] { 4, 0, 3, 7 });
        // Bottom face (Y-)
        mesh.createPolygon(new int[] { 0, 4, 5, 1 });
        // Top face (Y+)
        mesh.createPolygon(new int[] { 3, 2, 6, 7 });
        // ExEnd:CreateMeshUsingCreatePolygons
        return mesh;
    }


    private static List<Vector4> defineControlPoints()
    {
        // ExStart:DefineControlPoints
        // Initialize control points
    	List<Vector4> controlPoints = new ArrayList<Vector4>();
    	
        //Vector4List controlPoints = new Vector4List(8);
        controlPoints.add(new Vector4( -5.0, 0.0, 5.0, 1.0));
        controlPoints.add(new Vector4( 5.0, 0.0, 5.0, 1.0));
        controlPoints.add(new Vector4( 5.0, 10.0, 5.0, 1.0));
        controlPoints.add(new Vector4( -5.0, 10.0, 5.0, 1.0));
        controlPoints.add(new Vector4( -5.0, 0.0, -5.0, 1.0));
        controlPoints.add(new Vector4( 5.0, 0.0, -5.0, 1.0));
        controlPoints.add(new Vector4( 5.0, 10.0, -5.0, 1.0));
        controlPoints.add(new Vector4( -5.0, 10.0, -5.0, 1.0));
        // ExEnd:DefineControlPoints
        return controlPoints;
    }

@Hue404

Only the FBX import and export the hole data, the other format will ignore this. That means it is not working in other formats. We added a feature request as THREEDNET-1218 in our issue tracking system. As soon as it is resolved, all formats will have support for it and we will inform you in this forum thread as well. Please spare us some time.

thanks for the info, but I actually need it as a fbx file, but I still have no clue how to do this…

@Hue404

Your feedback has been recorded under the ticket. We will be sharing updates with you as soon as it is resolved. Please spare us little time.