1

I'm working on a system to automatically take 2D profiles of components and assemble them into 3D shapes.

Imagine given these pieces:

enter image description here

You want to make this shape:

enter image description here

I'm highlighting one of the components to show how they fit together.

I'm open to any suggestions on how to go about doing this but the current approach I'm attempting first finds joints that may fit together just by looking at the 2D profile.

enter image description here

How could I go about identifying the "tabs" from the polyline profile?

The same technique should also work on assemblies like such:

enter image description here

Edison
  • 53
  • 4

2 Answers2

0

You may define the "code" for a tab. For example:
3,C,5,C,3 would mean: Three units length, then turn 90º counter-clockwise, then 5 units length, then turn 90º counter-clockwise, then 3 units length.

Of course more identifiers than C can be used, for different angles and so.

A tab in another piece that fits in the tab of the first piece has the same (or very similar) 3,C,5,C,3 code
So, finding same code in both pieces may be a fit. Check if adjacents codes in both pieces also fit, and you're done.

Notice that pieces can be rotated. This case doesn't change the code, but may change the order of adjacents codes.

Spektre
  • 49,595
  • 11
  • 110
  • 380
Ripi2
  • 7,031
  • 1
  • 17
  • 33
0

see How to compare two shapes?

so you basically trying to find the "same" sequences in polylines encoded in the polar increment format (turn angle, line length) and then just check if relative position of matched sequences are the same in both shapes ...

Beware that the locks might have some gap between the joined shapes to ensure assembly is possible... in same case the gap might be even negative (overlap) depends on material and function so You need to compare the sequences with some margin ...

Also I would divide each shape into its sides to speed up the process as the lock is most likely not crossing sides ...

Spektre
  • 49,595
  • 11
  • 110
  • 380