Can't pick a toposurface and create a mesh from it

Hi guys,

I have this intricate toposurface that I need to turn into a mesh, so I can later export this mesh as OBJ, or even turn into a mass form through DirectShape. But Dynamo keeps complaining:

Warning: Mesh.ByVerticesAndIndices expects argument type(s) (Point[], int[]), but was called with (Autodesk.DesignScript.Geometry.Point[], Autodesk.DesignScript.Geometry.IndexGroup[]).

Doesn’t mater if I Topography.Mesh or @Vikram_Subbaiah code. What is the trick to get a workable mesh or the correct information to create a workable one?

PS: the error over Topography.Mesh node is Warning: One or more geometries have failed to convert due to this error: PolyCurves may be branching

The first line of code in the code block is just the scripted version of the Topography.Mesh node. They are both effectively the same.

Would be good if you can upload the topography you are having trouble with.

1 Like

Hi Vikram,

I’m sorry but I can’t upload the site. It’s a client information I’m not supposed to disclosure. My point isn’t the site actually: is the annoying multiple meshes thing with Dynamo. If I connect Topography.Mesh to any other node that works with meshes, the other node says the mesh is not the expected object.

I cannot extract the mesh with Topography.Mesh node and work this mesh later on. Is there any workaround?

Not sure if this will work, but you could try to recreate the topography by extracting the topography points and then try to get a mesh from the recreated topography (with slightly altered points).

Point.ByCoordinates(Math.Round(t.X,2),Math.Round(t.Y,2),Math.Round(t.Z,2));

3 Likes

I’m getting *"Warning: Topography.ByPoints operation failed. *
One or more points shared the same XY location (even with different elevations). This is not permitted for topography surfaces.
Parameter name: points"

I’ve tried to replicate the issue.
See if this helps…


topo.dyn (2.0 KB)

2 Likes

The version below might rebuild the original in a better way


topo.dyn (26.0 KB)

2 Likes

Better this time! I could model the toposurface this time. However, when trying to export the mesh, I got Warning: Mesh.ExportMeshes expects argument type(s) (string, Mesh[]), but was called with (string, Autodesk.DesignScript.Geometry.Mesh).

His is so frustrating…

TestTopoExportMesh.rvt (816 KB)

leTopoCriaMeshExportaOBJ.dyn (14.2 KB)

The graph below should mostly do what you want.
If it doesn’t work, you can try reintroducing some of the above steps.


topo.dyn (17.1 KB)

5 Likes

You nailed!

How is this possible? Isn’t just what I was trying to do at the first post? What’s the catch?

Same as the explanation @Thomas_Mahon provided you here

1 Like

for Dynamo it is not the same a Mesh than a toolkit Mesh, you have to convert mesh to toolkitmesh to be able to use the toolkit nodes.

You can convert the mesh with this code block by the way that I have been using before, same as @Vikram_Subbaiah last script shared. There is a node for that in Springs package as well, to convert the toolkit mesh to mesh, the opposite, as well, if you need.

vp = m1.VertexPositions;
fi = m1.FaceIndices;
fi2 = DSCore.List.Flatten(DSCore.List.Transpose([fi.A,fi.B,fi.C]));
tkMesh = Dynamo.Mesh.ByVerticesAndIndices(vp,fi2);

1 Like

Unfortunately that did not work for me, I understand the points are grouped and sorted by coordinates, you just flatten the results and create new topography, although @Vikram_Subbaiah moves to right side slightly the points, but in my case same result of polycurves may be branching


can this be a matter of decimals precision? I tried to use in the node group by key a key of the point but converted as string and I got less unique keys than points, that means some are very close to 3 decimals, what do you think about that?

I saw dynamo has precission until 0,0000.
May be the round to decimals be the solution?
image

I tried to see what happens with the points rounded to 4 digits, the result is that there are less unique points and also some points have same XY warning when trying to create topography from those new points.

I tried with 6 digits and I am allowed to create a new topography from new unique points but I get same warning of Polycurves may be BRANCHING. Should I simplify the topography somehow? is there any geometrical limit for a mesh with points that are very close to each other?

Thanks

1 Like