×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Point Mapping Algorithms

## Point Mapping Algorithms

(OP)
I am on the hunt for mapping algorithms to link structural engineering software beams and columns to revit beams and columns.

The problem:

Often our revit models and engineering models are located at differing points in global space and maybe even rotated. I want to be to map the two models together with some form of a tolerance.

See image below:

I have written some sloppy code previously to tackle this problem, but it requires manual input for mapping the global coordinates between the two programs and could not handle a rotation type parameter.

Also, if one of the gridlines gets significantly off (say 3'-0" or more), the sloppy mapping algorithm falls apart and flags all other elements as being out of sync. Maybe a good mapping algorithm could tackle this, flagging the offending bay, and then mapping correctly the remaining bays beyond?

Anyways, the end goal is to map beam and columns from one piece of software to another, with a robust mapping algorithm.

I am fine with sticking with 2d if need be, but the end goal would like be a full 3d solution. Assume that all grid line locations are known between the two pieces of software and all beam/column coordinates are known.
Are there any famous algorithms for mapping points between one "system" to another "system"

### RE: Point Mapping Algorithms

Are these actual points, ala point clouds, or are they proprietary structures?

assuming point clouds, it sounds like you want to do this https://en.wikipedia.org/wiki/Point-set_registrati....

possibly this http://www.open3d.org/docs/0.7.0/tutorial/Basic/ic...

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

### RE: Point Mapping Algorithms

(OP)
These are not point cloud "points", these are "points" that represent beam and column ends. Sorry for the grainy images before, the images should be more clear now with text.

The Point Set registration stuff is pretty interesting, might be the ticket.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

#### Quote:

these are "points" that represent beam and column ends.

Not sure that matters, since the set of points is a point cloud, and you'd have to extract them from each program anyway, if you wanted to correlate them

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

### RE: Point Mapping Algorithms

(OP)
Yep, tend agree there IRstuff, I will try to dig in a bit this weekend to see if these hold any promise.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

You can construct a transformation matrix for the desired new location. Each point in the original model can be multiplied by the matrix to get the new coordinates. You will find a lot of resources online if you search for "transformation matrix", "point coordinate transform", or similar terms.

I'd be surprised if numpy doesn't have something useful for this situation.

### RE: Point Mapping Algorithms

quick thought is you should be able to accomplish it as long as you know two anchor points:

Use one of the two anchor points to determine the required x,y translation then use the other anchor point to determine the required rotation. Use this information to determine the transformation matrix to then apply to the other points.

### RE: Point Mapping Algorithms

Oh I think I get what you want to accomplish:

1. determine two anchor points between the structural model and revit model (probably needs to be a manual entry)
2. determine transformation matrix to go from the structural model to the revit model
3. apply transformation matrix to the structural model data
4. Map structural columns to revit columns, during this procedure allow for a radius of tolerance. Log elements without a match ie poor model coordination

After transformation matrix applied:
matched_cols = []
matched_beams = []
tolerance = 1

for rcolumn in revit_columns:
for i, scolumn in enumerate(amodel_columns):
if vector_distance(scolumn, rcolumn) <= tolerance:
matched_cols.append(scolumn)
amodel_columns.pop(i) # remove the matched column from the list, speed up each inner loop cycle

#anything left in the amodel_columns list is an orphaned element

for rbeam in revit_beams:
for i, sbeam in enumerate(amodel_beams):
idelta = vector_distance(sbeam[0],rbeam[0])
jdelta = vector_distance(sbeam[1],rbeam[1])

if idelta <= tolerance and jdelta <=tolerance:
matched_beams.append(sbeam)
amodel_beams.pop(i)

#anything left in the amodel_beams list is an orphaned element

### RE: Point Mapping Algorithms

(OP)
Celt,

You have the process really well locked down.
The code you have outlined I currently have written up and what I have deemed as "sloppy".

Currently I have to manually perform steps 1-3, I think I can get this automated.

Step 4 is the part where I was hoping to come up with a better algorithm. My system works exactly as you have outlined, checking if start and end nodes are within a defined radius tolerance, then the beam is mapped

This system falls apart in the second example I posted though, with the bays beyond the misaligned grid line all not mapping. Maybe this is intended? If I could get a more robust algorithm to match grids C-E that would be awesome, but probably a much more in depth solution.

Posted again for reference:
Original Space

Mapping Space - B to C gains 5'-0" from the original space, causing for a flag of all beams beyond column line C

Thanks Cowski, I think that transformation and coordinate side should be pretty easy to handle, the biggest part of this is trying to come up with a robust mapping algorithm.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

yeah that wouldn't match in my approach because the structural model and Revit model are off entirely by 5ft horizontally beginning at grid B.
If this was a simple modeling error where grid line B was just shifted such that A-B was 15 ft and then B-C was 20 ft then it would work because C-E would be in the right relative locations, but what your screenshots show is a complete lack of coordination between the design and drafting models.

### RE: Point Mapping Algorithms

For modeling discrepancies of that magnitude I don't think mapping is the way to go as the coordinates won't really every match up. This is where you'd need some kind of unique identifier and a database to keep track of the elements (if I recall this is what a lot of analysis software -> Revit links are doing to manipulate element positions bidirectionally).

### RE: Point Mapping Algorithms

(OP)

#### Quote (Celt83)

what your screenshots show is a complete lack of coordination between the design and drafting models.

That's a good point, I think something like a grid line misalignment should be flagged pretty frequently. I worry about larger buildings slowly accumulating 6" of deltas over 20 times to the point where it no longer maps.

Of note, I think complete lack of coordination between design and drafting models happens way more than we like to admit. I am hoping this tool can solve this. I know many times where I have been up around 10'-0" misaligned with the drafting model and because the general shapes match between engineering and drafting model, it masks the problem.

Maybe the "sloppy" code is best approach and this is easier than what I originally had thought.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

For the most robust system with arbitrary misses outside of say 10%(ACI 318-19 6.6.4.2) I think you'd need to rely on matched element ID's and not coordinate positions.

### RE: Point Mapping Algorithms

(OP)
I'll try out a few options and see which one works out better, I think the more advanced mechanisms may still be of value. Maybe a user option on mapping algorithms.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

Ok, so the alternative is 3 translations and 3 rotations, i.e., 6 unknowns, so if you have more than 6 points and they are exactly matched, you will find a solution that maps exactly. If they don't match exactly, then the two structures are not identical, but the coordinate transformation will be close enough for you to see what's not matching.

{edit] plus magnifications, I guess, so possibly 3 additional unknowns, unless there's just a global magnification

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

### RE: Point Mapping Algorithms

What’s the end goal here map analysis to documentation and transfer key results to Revit family parameters ( beam end reactions, column base reactions, etc.) or are you looking to do actual geometric manipulation to either the analysis or documentation model to bring them in line?

### RE: Point Mapping Algorithms

(OP)

#### Quote (IRstuff)

Ok, so the alternative is 3 translations and 3 rotations, i.e., 6 unknowns,

Yep, youve got it, I think we can eliminate (2) of the rotational parameters, I think the only realistic rotational parameter I will have is about vertical Z axis. I do not expect to have to deal with rotation about X or Y.

#### Quote (Celt)

What’s the end goal here

Main goal is a QA/QC checker for our analysis models and our drafting models.

Ideally it can flag big discrepencies in beam/column locations and then also flag if the beam size/any other parameter does not match between the two pieces of software.

Whole model manipulation is not the goal at this time.

S&T - www.re-tug.com

### RE: Point Mapping Algorithms

OK, so 3 translations, rotation about Z, and a single scaling? That's something that could be dumped into a least-squares solver. Then, each point can be checked for coincidence after transformation. If they don't match, then something is off in one of the two models. That's something I think students do in computer science classes, particular in either image processing or computer game programming

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

### RE: Point Mapping Algorithms

To 'diff' an analysis model with a production model as a form of QA/QC, I recommend using grasshopper with the BHoM library
The BHoM library will allow you to database the elements of your respective models (as well as grid locations) and grasshopper components can be used to perform the comparison calculations which can be as simple as the distance formula between endpoints or midpoints or both. Where distances exceed some allowable tolerance, these members can be flagged in Revit model as a color override with further libaries (RhinoInside).

[https://www.structuremag.org/?p=18847]

### RE: Point Mapping Algorithms

(OP)
Thanks for the info e95kwon, I have seen the BHoM library before, but haven't used it.
We do not have rhino/grasshopper at our office so this won't not work for me.

There's also no fun in using a prebaked system! It should be an interesting coding exercise.

S&T - www.re-tug.com

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!