Z Coordinate from Topo

The issue with projecting directly onto the polysurface is that it explodes the polysurface and projects on each of the surfaces… That’s why I used the surface.thicken node in my graph .

@Mostafa_El_Ayoubi

First thanks for your reply, but I am facing issue with surface.thicken node, please see below images. In the second image, the geometry got very irregular shape, i dont know exactly whats wrong, any sugeestion?

@Alisder_Brown

Thanks for your reply also, I tried your solution also, but not working (please see below image). the point.project node showing “empty list”. any suggestion or correction in my node?

try with a smaller thickness (the default value is 1). Try 0.1 for example . (i know thi is not the cleanest of methods :slight_smile: )

@Mostafa_El_Ayoubi

script is a bit faster (may be because mesh node is selected). I tried with surface thickness to 0.1, still there is no change, any suggestion?

Converting the mesh to a Polysurface is the slowest step in the graph. You could try the “Mesh.ToPolySurface” node in spring nodes (version 100.0.1 + ). It’s multi-threaded and should perform the conversion noticeably faster. You’ll first need to extract the mesh from the topo with the “Topography.Mesh” node.

1 Like

@Rock_Ali

you could try this :

this definition gets rid of the points that are projected on unwanted surfaces from the polysurface . I hope this helps :

def projectonpolysurface(pts :var[] , poly, direction)
{
faces = poly.Surfaces();
list = {};
return = [Imperative]
	{
	for (p in pts)
		{
		for (f in faces)
			{
			proj = f.ProjectInputOnto(p,direction);
			test = f.DoesIntersect(proj);
			list = Flatten({list , List.FilterByBoolMask(proj,test)["in"]});
			};
		};
	return = list;
	};
};

@Mostafa_El_Ayoubi

Thanks for your efforts, I realy appreciate. It took me whole last night for topo to polysurface in dynamo, but after that I tried your defination still no result (can see in image, background has more protrusions) may be I am doing something wrong or the defination is not working for my topo, any more help?

Thanks in advance

.

the definition needs a 3rd input : the direction of projection. In your case is the ZAxis vector .

Also, I wrote this definition pretty fast … It will only handle a flat list of points so flatten your list before you input it . I’ll try and make it more robust in the future.

@Mostafa_El_Ayoubi

still not a change

def projectonpolysurface(pts :var[] , poly)
{
faces = poly.Surfaces();
list = {};
return = [Imperative]
	{
	for (p in pts)
		{
		for (f in faces)
			{
			proj = f.ProjectInputOnto(p,Vector.ZAxis());
			test = f.DoesIntersect(proj);
			list = Flatten({list , List.FilterByBoolMask(proj,test)["in"]});
			};
		};
	return = list;
	};
};

can you try this code ? this one has the direction already set so no need for third input

I’m not sure if it’s a dynamo version issue … I’m working on 1.1 and revit 2016.
I wrapped the definition in a node called projectontopolysurface in the package Node-Mode. Maybe you can give it a try … It works for me :slight_smile: :

@Mostafa_El_Ayoubi

I tried with your new node “projectontosurface” in the package Node-Mode, but the result is empty (please see image below). I am using dynamo 1.1.0 version and revit 2015. This time i tried with another small topography, but still not succeed to get z point, getting a bit frustration with Z point…anymore suggestion??? or if you like to give a try with my topo and data points (X and Y points), I will post them, thanks in advance

Can you drop your topo file ?

1 Like

@Mostafa_El_Ayoubi

Please find the attached topo.

TopoTest_Part.rvt (1.6 MB)

@Mostafa_El_Ayoubi

Did you give a try with the topo, please let me know the result, thanks in advance.

Hi @Rock_Ali

sorry i didn’t have time to look at it this week. It looks like the problem occurs when the topo is turned into a polysurface :

when i break down the process of what’s going on in the topography.topolysurface , it turns out the issue is that the triangles of the mesh can’t be created because some points are coincident which, to be honest, I don’t really understand:

It then gets really hard to exploit the output …

@Mostafa_El_Ayoubi

I really appreciate your support mate, then I left with no other choice than aligning manually all the families, but thanks a lot for try and lets if any other person will give us solution (for future reference). Take care and cheers!

No problem @Rock_Ali ,
here’s a workflow that will work even though it’s not the cleanest :

Though projectinputonto doesn’t seem to work with that polysurfaces, drawing lines with line.ByStartPointDirectionLength will allow you po get the projection of the points on that polysurface. It will save you some labor.

Hope it helps.

@Rock_Ali This should work
ProjectPointTopo.dyn (6.2 KB)

iA=List.GetItemAtIndex(T.Mesh.VertexPositions,T.Mesh.FaceIndices.A);
iB=List.GetItemAtIndex(T.Mesh.VertexPositions,T.Mesh.FaceIndices.B);
iC=List.GetItemAtIndex(T.Mesh.VertexPositions,T.Mesh.FaceIndices.C);
//Surfaces
TopoSurf=List.Clean(Surface.ByPerimeterPoints(List.Transpose({iA,iB,iC})),false);
//Polysurface combining Surfaces
TopoPlySurf=PolySurface.ByJoinedSurfaces(TopoSurf);

What is the issue with the highlighted within the image? Revit 2018.1 does not seem to cope with TopographyToPolysurface!