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: 

ReferenceIntersector to an arc

6 REPLIES 6
Reply
Message 1 of 7
bcampbell11
394 Views, 6 Replies

ReferenceIntersector to an arc

I am trying to use ReferenceIntersector on the edge of a slab.  It all works great until I need it to go to the edge of a slab where there is an arc.  It stops short of the edge a random amount.  Any ideas?  

6 REPLIES 6
Message 2 of 7
jeremy_tammik
in reply to: bcampbell11

The reference intersector shoots a ray through the model.

 

The ray is infinitely thin.

 

An edge, such as your arc, is infinitely thin, too.

 

The mathematics being performed is digital floating point, so you cannot calculate any real numbers exactly.

 

The probability of intersecting an infinitely thin edge with an infinitely thin ray is basically zero.

 

Due to floating point errors, you may get a hit or two anyway.

 

Regardless, the results will be basically random and almost useless.

 

I suggest you rethink your approach and try to shoot the ray at a face instead, with a non-zero area and a non-zero probability of finding an intersection.

 

That will make your results more predictable and useful.

 

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

I tried it using face and get the same results.  It works perfectly on everything else but a curve.  I will look for another way to do this, but am thinking it may not be possible.  

Message 4 of 7
jeremy_tammik
in reply to: bcampbell11

What exactly are you trying to achieve? What works, what does not?

 

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

So I am trying to draw lines to the extents of a structural slab.  As far as I can tell, it works great as long as the edge from that location is a straight line or an angled line.  If it is a curve, then it wont go to the edge for some reason.  

I was starting to think about using tessellate somehow.  Although, I have not used this method before.  See attached image for clarity.  I was able to get the program to this point very fast using the ReferenceIntersector, which was great!

Thanks!

Message 6 of 7
jeremy_tammik
in reply to: bcampbell11

This looks like a pure 2D problem. The reference intersector is a pure 3D tool. It is not appropriate for your use. I am surprised it worked at all. You can almost certainly use it anyway, though. Just ensure that your ray casting is not happening in the top or bottom face of the slab, but in the middle. Then, your ray will intersect the vertical faces right, left, top and bottom. Forget about the edges. You can get the faces, and all will be well. I, being all too perfectionistic, would prefer to implement a pure 2D solution for this pure 2D task.  However, you can regard it as a 3D task, and then project the results into the desired 2D plane, if you find that easier, and already have the working code for it.

   

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

I guess getting the information from the 3D slab is really where I am stuck.  Maybe I will try using 3d object to intersect the slab rather than a line.  Then collect location information from the object to use later, and lastly, delete the object.   Even though I ultimately want to draw lines, drawing them once information is collected is simple.

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

Post to forums  

Forma Design Contest


Rail Community