Projecting a solid onto a surface


#1

Hello,is it possible to project a solid onto a surface from a given vector? Kinda like a shadow but just a straight projection? And the loft between the two? The vector is important because I would be doing it from underneath. Are there noses or packages for this kind of thing? Thanks!


#2

Surface.ProjectOnto should work but you have to get the base level lines first. Post a bit more and I can try to walk you though it.


#3

Ok thanks! I thought that node only did curve geometry. Let me look into it and I will up date you on my progress. but it sounds like I might be able to figure it out if it does what you say it does.


#4

I belie it does only do lines. Geometry.Explode will be a requirement if that’s the case.


#5

Yeah its not working at all. How do I explode it but project only the top/bottom surface?


#6

This post might be helpful: Flatten Solid onto plane


#7

Hi Nick, that seems awesome but how do I change the projection vector? and the distance to the plane it is projecting on? Not sure I understand how to do that. I want to be able to give it a plane and a vector, but I am not sure how. Plus, it keeps crashing revit on me…


#8

The Vector for projection seems to be based on the Line, s1. The plane is also assumed to be normal to the vector in Vikram’s solution.

If you’re projecting onto a plane that isn’t normal to your vector you’ll have to go with Jacob’s method using ProjectInputOnto and convert your geometry to curves.


#9

Yes, I am doing the latter. I am having moderate success. Is there anyway, to distinguish which lines are the perimeter that anyone sees? I am getting a lot of garbage lines in the middle of he projection. Or do I need these to do the loft between the two maybe…?? I would need a way to distinguish the top and bottom surfaces to be able to loft wouldnt I?


#10

You’ll just have to do some cleanup and see what works. You could getting the bottom or top surface of your solid before projecting the curves or you could removing all lines that overlap (that might get all of them though). I think the post I linked has someone patching all those curves again then removing those surfaces from a large planar surface to essentially get the space left by the projection. You’ll just have to test a few things out.


#11

Is there a way to distinguish between the top and bottom surfaces as you suggest? Or do I have to do it manually by pairing the two and comparing the z offset?


#12

Depends on the shape of the geometry.

Get the normal at the surface midpoint as one method if you’re looking at cubes. If the Z value is ~1 or ~-1, it’s near the top. That or you can get a bounding box and find the surface(s) closest to the min point and max point. If your geometry is complicated you may want to consider a select face method to speed things along.