Extracting CAD object identification data from 3dm files

Several years ago a company asked me to make them a few basic shop drawings. A couple years and a thousand plus product drawings later they asked me if it’s possible to go back and extract data on all the individual objects within all their 3dm files as base data input for inventory management operation. (Extracting/classifying that existing data manually would take too much time.)

Their 3dm dwgs can be as simple as only one 3D object like an injection molded part ranging to 30-40 individual objects in an assembly comprised of a small number of standard cross section extruded to varying lengths plus injection molded parts.

My questions:

My searching has turned up examples of several SW products that can read Rhino3D datafiles, but I’m drawing a blank as they are accessing data that is not geometry related (at least what I searched up so far). Can anyone offer suggestions about SW to access 3dm geometry data?

Second, if this is possible, it would be particularly helpful if I could use a pattern classifier to search the extracted geometry data and match them against pre-trained geometry objects (such as different types of extrusion cross sections … to just id them as Extrusion ABC with a length parameter and/or simply an one-off injected molded part XYZ with no further data required.

Ultimately, the output records would have at least 3 data fields:
GeometryID, ExtrusionLength (if any) and 3dmFileName

Does anyone have experience with these and can suggest practical software tools to accomplish the task?

Best regards,

Bruce

Can you post an example file?

As someone who attempted something like this 10 years ago–for a smaller number of items, with files that I MADE–I’m gonna say in theory yes in practicality no don’t even try since Rhino objects don’t “exist” in a defined part/assembly hierarchy like SolidSomething and they weren’t specifically created with this task in mind.

Japhy,

Here is stripped down 3dm example.

Test Example.3dm (3.4 MB)

For this simple example, the extractor code would generate four records.

  1. 5x5 extrusion, extrusionlength, filename, quantity
  2. 2x3.5 extrusion, extrusionlength, filename and quantity
  3. 0.875 extrusion, extrusionlength, filename and quantity
  4. 5x5 injected molded part, NullLength, filename and quantity

I appreciate your thoughts!

Bruce

Unfortunately there isn’t any User Data or Object Name that can be used to classify, it looks like dimension is the primary sorting factor available. This is totally doable on multiple files using Rhino 8 & Native Grasshopper.


Rhino8-Import-Geometry.gh (10.6 KB)

Wow, using a bounding box is a very clever solution!!! I’ve only been using Grasshopper about a year. It’s capabilities still blow me away.

If I understand correctly what you’ve done w Grasshopper is (1) imported all the 3dm objects, (2) encapsulated them in bounding boxes, (3) deconstructed each of the 21 object’s bounding boxes to get the xyz dimensions of each object … and displayed the object’s width, length and height parameters in their respective panels.

With a quick glance at the panels I can see that items 0-1 are the caps, 2-16 are the boards, 17-18 are the horiz rails and 19-20 are the vert posts. Nice!

Your key leap of logic is to bypass doing the precise geometric matches making the very likely assumption that each object’s xyz bounding box size carries enough unique information to query all the objects against a predefined part number and its bounding box definition. With a little time thinking about the size range of parts we have, I believe that with some careful selection of testing tolerances, your assumption is completely valid given the wide dimensional variations for the parts I know.

So to make this work, I need a Grasshopper to scan all the .3dm directories and output all the bounding box xyz dimensions plus filenames to a four field database.

Then sort those down into matching size groups and assign appropriate part numbers to that entire group … ultimately having a record with partnumber (as key) and xyz dims.

Gotta think a bit deep on this … thanks for the great input!!!
Bruce

Sort and count would be something like this…


Rhino8-Import-Geometry-v2.gh (15.6 KB)

Japhy,

This is very cool.

Is it feasible to point this to a file directory holding multiple .3dm files and then export all the resulting object records out to a csv with XYZ and a fourth field holding the record’s filename?

Best regards,
Bruce

Here is something to get you started.

I created a folder with slight modification on some of the files

Then read the folder, got the file name and assigned a part number.

The part name could be matched up several ways, a post process not tied to the Set output would be better, the set could change order if another file was added for example.

Data Management (accounting for outliers, tree management) can be tricky, best to double check, then triple check all your results to ensure no mistakes are made.

Japhy,

This will be a most excellent conceptual learning experience unwinding what you designed in my head. I learn best by inductively seeing how stuff works.

Could I trouble you to drop the .gh of your last layout?

Thank you so much!!!

Best regards,
Bruce

Apologies, i thought it was in the post.

Rhino8-Import-Geometry-V3.gh (19.9 KB)

Note that there are assumptions… such as all the geometry is aligned with the XY plane, if there were conditions at an angle then the XY bounding box would need a plane.

No worries! Thank you very much for the good learning opportunity. This is great stuff.

I’ve been using McNeel products for nearly a decade and recommending them to everyone in my engineering/tech circle. Had a customer that runs a 15 person shop with one SolidWorks seat tell me a little while back that he delayed his last $10k upgrade. I explained the McNeel philosophy and suggested he buy Rhino8 and convert just one of his products over as a trial. I showed him making different sized models in minutes with GH and his jaw dropped. :joy:

Y’all are doing the right stuff for the long haul. Don’t ever let the white shoe financial boyz in the door.

Best regards,
Bruce

1 Like