Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mapping planar curves to surface

2 REPLIES 2
Reply
Message 1 of 3
stefanome
768 Views, 2 Replies

Mapping planar curves to surface

stefanome
Collaborator
Collaborator

Is it possible to map planar curves to a generic surface in Revit?

 

I'm looking for something similar to the Decal command in Inventor, but I need it to work with curves rather than with images.

 

The Wrap option of the Project to Surface command in an Inventor 3D sketch does something similar, but only works on developable surfaces.

 

My surfaces will all be almost-but-not-really developable. Meaning they will be slightly twisted planes (imagine a 60' x 20' wall with one corner that is 1" off the vertical) or ruled surface between two almost-but-not-completely-identical splines.

 

This animation shows the curves mapped to a surface that is not developable (made in ThinkDesign). 

curve plane to surface mapping.gif

My surfaces will not be developable, but will be closer to developable than the one in the animation. Imagine a slightly twisted plane like a 60' x 20' wall with the left edge vertical and the right edge leaning 1" out, or a ruled surface between two almost-but-not-exactly-identical splines. The architect asks for a flat vertical wall or for a perfect wave, but we laser scan the building and find out that the framer screwed up and the walls are not vertical or the wavy surfaces aren't as they should be, but we need to clad them anyway. So I need to map the grid of panels to the surface the framers give me, not to the surface the architect had on their mind.

 

I am afraid that the answer is no, Revit doesn't have an API that does this kind of projection, but I thought I would ask anyway.

 

In the case that the answer is no, this is how I think I will follow this logic, please let me know if you have comments that could help:

  • Input:
    • Planar curves
    • Surface
    • UV point on surface where to place the bottom left point of the planar curves
  • Find the width and height of the planar curves bounding box
  • Find the UV of the top right corner such that the length of the lines (u1,v1)-(u1,v2)-(u2,v2)-(u2,v1) are as close as possible to the width and height of the planar curves bounding box
  • Create curves on the surface by interpolating the start and end points for straight lines from the planar curves bounding box to the (u1,v1)-(u2,v2) area of the surface
  • Doing something similar using the tessellation for non straight planar curves

This will work assuming that the U lines will be close to being perpendicular to the V lines. For example it will work on cylinders, but not on cones. But, as I said, my surfaces are slightly twisted or almost cylindrical, and this algorithm should work.

0 Likes

Mapping planar curves to surface

Is it possible to map planar curves to a generic surface in Revit?

 

I'm looking for something similar to the Decal command in Inventor, but I need it to work with curves rather than with images.

 

The Wrap option of the Project to Surface command in an Inventor 3D sketch does something similar, but only works on developable surfaces.

 

My surfaces will all be almost-but-not-really developable. Meaning they will be slightly twisted planes (imagine a 60' x 20' wall with one corner that is 1" off the vertical) or ruled surface between two almost-but-not-completely-identical splines.

 

This animation shows the curves mapped to a surface that is not developable (made in ThinkDesign). 

curve plane to surface mapping.gif

My surfaces will not be developable, but will be closer to developable than the one in the animation. Imagine a slightly twisted plane like a 60' x 20' wall with the left edge vertical and the right edge leaning 1" out, or a ruled surface between two almost-but-not-exactly-identical splines. The architect asks for a flat vertical wall or for a perfect wave, but we laser scan the building and find out that the framer screwed up and the walls are not vertical or the wavy surfaces aren't as they should be, but we need to clad them anyway. So I need to map the grid of panels to the surface the framers give me, not to the surface the architect had on their mind.

 

I am afraid that the answer is no, Revit doesn't have an API that does this kind of projection, but I thought I would ask anyway.

 

In the case that the answer is no, this is how I think I will follow this logic, please let me know if you have comments that could help:

  • Input:
    • Planar curves
    • Surface
    • UV point on surface where to place the bottom left point of the planar curves
  • Find the width and height of the planar curves bounding box
  • Find the UV of the top right corner such that the length of the lines (u1,v1)-(u1,v2)-(u2,v2)-(u2,v1) are as close as possible to the width and height of the planar curves bounding box
  • Create curves on the surface by interpolating the start and end points for straight lines from the planar curves bounding box to the (u1,v1)-(u2,v2) area of the surface
  • Doing something similar using the tessellation for non straight planar curves

This will work assuming that the U lines will be close to being perpendicular to the V lines. For example it will work on cylinders, but not on cones. But, as I said, my surfaces are slightly twisted or almost cylindrical, and this algorithm should work.

2 REPLIES 2
Message 2 of 3
jeremy_tammik
in reply to: stefanome

jeremy_tammik
Autodesk
Autodesk

You could easily solve this by a pretty good approximation:

 

  • Tessellate your curves.
  • If the tessellation generates too few points, add some in between (e.g., for a straight line segment)
  • Project the tessellation points onto the surface
  • Connect the dots

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

You could easily solve this by a pretty good approximation:

 

  • Tessellate your curves.
  • If the tessellation generates too few points, add some in between (e.g., for a straight line segment)
  • Project the tessellation points onto the surface
  • Connect the dots

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3
stefanome
in reply to: jeremy_tammik

stefanome
Collaborator
Collaborator

@jeremy_tammik wrote:

You could easily solve this by a pretty good approximation:


I need the curves to be on the surface, because I need to trim the surface with those curves. Oops, I forgot to mention that! I need to create one surface on each "cell" of the grid and I hope there are APIs to copy the surface and trim it with a new set of boundary curves, the ones I am trying to create.

 

In some cases the panel will be one face (planar or not), in other cases (aluminum composite panels) the surface will have return legs or multiple faces (to wrap around parapets or building corners) and will need to be unfolded (I will create an unfolding algorithm to take care of that).

 


Project the tessellation points onto the surface

The "project" part is the tricky one here. When the surface is very close to a plane, like a slightly twisted wall, I could project using the normal to the plane as projection direction. But when the surface is completely different, for example a cylinder, using a projection direction will not work. That's why I am looking at XY -> UV interpolation, and that's why in my previous post I specified the Wrap option in the Inventor surface projection.

 

Look at this image: when we scan buildings like this, we find out that the vertical cylinder is not really one cylinder and we end up with splitting it in 5-6 arcs, each with different radius. They usually are vertical, but they are not the cylinder the architect had in mind. The wavy area on the right is usually worse: the architect asks the framer to make two identical profiles and place the one in the front slightly lower and create a slope. Then we scan the building and find out that the two profiles in the front and in the back are not identical. The slope on the flat area is different from the slope on the first wave which is different from the slope on the second wave. 

stefanomenci_0-1617397305296.jpeg

I want to draw the grid on a plane based on the material size and other constraints, and then wrap it around whatever surface the laser scanner is throwing at me. The plane with the grid will be the wall plane in the 90% of cases, where the wall is flat and in the 8% of cases where the wall is almost flat, and will be anywhere in the model when the grid needs to be wrapped around a surface. The add-in will keep track of what grid is projected/wrapped around what wall/surface.

 

Why bothering doing this in Revit rather than in Inventor or any other more flexible tool?

Because I need this kind of flexibility only in the 2% of cases and I don't want to miss the advantages of working with Revit when the walls are nice and vertical.

 

But I don't want to miss that 2% of walls because we may find out that a wall is not vertical when we are half way in the production of a job.

 

And I don't want to use another tool for that 2% of cases because it would mean creating an add-in for Revit for the 98% of panels and duplicating the whole thing in another environment for the 2% that Revit can't do.

 

That's why I would rather struggle a little and teach Revit to crunch every kind of surface we may end up with.

0 Likes


@jeremy_tammik wrote:

You could easily solve this by a pretty good approximation:


I need the curves to be on the surface, because I need to trim the surface with those curves. Oops, I forgot to mention that! I need to create one surface on each "cell" of the grid and I hope there are APIs to copy the surface and trim it with a new set of boundary curves, the ones I am trying to create.

 

In some cases the panel will be one face (planar or not), in other cases (aluminum composite panels) the surface will have return legs or multiple faces (to wrap around parapets or building corners) and will need to be unfolded (I will create an unfolding algorithm to take care of that).

 


Project the tessellation points onto the surface

The "project" part is the tricky one here. When the surface is very close to a plane, like a slightly twisted wall, I could project using the normal to the plane as projection direction. But when the surface is completely different, for example a cylinder, using a projection direction will not work. That's why I am looking at XY -> UV interpolation, and that's why in my previous post I specified the Wrap option in the Inventor surface projection.

 

Look at this image: when we scan buildings like this, we find out that the vertical cylinder is not really one cylinder and we end up with splitting it in 5-6 arcs, each with different radius. They usually are vertical, but they are not the cylinder the architect had in mind. The wavy area on the right is usually worse: the architect asks the framer to make two identical profiles and place the one in the front slightly lower and create a slope. Then we scan the building and find out that the two profiles in the front and in the back are not identical. The slope on the flat area is different from the slope on the first wave which is different from the slope on the second wave. 

stefanomenci_0-1617397305296.jpeg

I want to draw the grid on a plane based on the material size and other constraints, and then wrap it around whatever surface the laser scanner is throwing at me. The plane with the grid will be the wall plane in the 90% of cases, where the wall is flat and in the 8% of cases where the wall is almost flat, and will be anywhere in the model when the grid needs to be wrapped around a surface. The add-in will keep track of what grid is projected/wrapped around what wall/surface.

 

Why bothering doing this in Revit rather than in Inventor or any other more flexible tool?

Because I need this kind of flexibility only in the 2% of cases and I don't want to miss the advantages of working with Revit when the walls are nice and vertical.

 

But I don't want to miss that 2% of walls because we may find out that a wall is not vertical when we are half way in the production of a job.

 

And I don't want to use another tool for that 2% of cases because it would mean creating an add-in for Revit for the 98% of panels and duplicating the whole thing in another environment for the 2% that Revit can't do.

 

That's why I would rather struggle a little and teach Revit to crunch every kind of surface we may end up with.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report