Bug? Meshing vertices Z alwasy 0


#1

Hi All,

Am I doing something wrong?

I am meshing a Brep then want to check the vertices position:

Dim mp As New Rhino.Geometry.MeshingParameters
mp.RelativeTolerance = 0
mp.GridAngle = 0
mp.GridAspectRatio = 0
mp.MinimumEdgeLength = 0
mp.MaximumEdgeLength = 5
mp.Tolerance = 0.05
mp.GridMinCount = 0
mp.RefineGrid = True
mp.JaggedSeams = False
mp.SimplePlanes = False
Dim meshes() As Mesh = Mesh.CreateFromBrep(myBrep, mp)

For Each m As Mesh In meshes
    ptList.AddRange(doc.Objects.AddPoints(m.Vertices))
Next

All vertices in my list are location on Z = 0.

When I first add the mesh to the doc and load it in again the Z is correct.
Do I need to do something after I mesh it?


(Radovan Grmusa) #2

Hi

Strange. If I do the same in C# I got it Ok, points have different Z:

    private Result testMesh(RhinoDoc doc)
    {

            GetObject go = new GetObject();
            go.SetCommandPrompt("Select brep to mesh");
            go.DeselectAllBeforePostSelect = true;
            go.DisablePreSelect();
            go.GeometryFilter = ObjectType.Brep; ;
            go.GetMultiple(1, 1);
            if (go.CommandResult() != Result.Success)
                return Result.Failure;
            var brep = go.Object(0).Brep();
            var meshes = Mesh.CreateFromBrep(brep);
            List<Guid> ptList = new List<Guid>();
            foreach (var m in meshes)
            {
                ptList.AddRange(doc.Objects.AddPoints(m.Vertices));
            }
            for (int i = 0; i < ptList.Count; i++)
            {
                var pp = doc.Objects.Find(ptList[i]).Geometry as Point;
                RhinoApp.WriteLine("point i = {0}, Location = {1}  ", i,  pp.Location);
            }
            doc.Views.Redraw();
        
        return Result.Success;
    }

R