## 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"

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

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

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

S&T - www.re-tug.com

## RE: Point Mapping Algorithms

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

S&T - www.re-tug.com

## RE: Point Mapping Algorithms

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

## RE: Point Mapping Algorithms

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

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

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

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

## RE: Point Mapping Algorithms

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

## RE: Point Mapping Algorithms

S&T - www.re-tug.com

## RE: Point Mapping Algorithms

{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

## RE: Point Mapping Algorithms

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.

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

TTFN (ta ta for now)FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg

## RE: Point Mapping Algorithms

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

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