Menu

#334 bad results from 3dm import

open-accepted
5
2012-10-10
2012-10-09
Anonymous
No

I got someone to export the solid works in 3dm, but the results were not good.

Discussion

  • Sean Morrison

    Sean Morrison - 2012-10-09

    I confirmed the failures on your geometry. The exported 3dm is not valid -- there are problems with the complex entity names. The objects were exported with names like "(#42052) Saddle Side Panel" which is not valid for 3dm. (I believe the parenthesis, #, and spaces are not legal)

    There is a programmatic way to fix the files (model.Audit(true)) that I'll see if we can get added to our importer to try and automatically fix such problems.

    As a workaround, the STL files will all import but will require a little work to combine all of the data back into a single model (STL requries one object per file).

     
  • Sean Morrison

    Sean Morrison - 2012-10-09
    • assigned_to: nobody --> brlcad
    • milestone: 387263 --> other bug / workaround
    • status: open --> pending-accepted
     
  • Anonymous

    Anonymous - 2012-10-09

    about the stl files, there is a zip file with them here
    https://ia701500.us.archive.org/32/items/CEB_Press_IV/CEBIV.stl
    when i try to read one :
    mdupont@mdupont-Aspire-7750G ~/Downloads/OSE/STL $ /usr/brlcad/bin/stl-g -d '01-001-00-0 - 01-063-00-0-1 01-060-00-0-1.STL' test.g
    Converting Part: 01-001-00-0
    Using solid name: s.01-001-00-0
    01-001-00-0 has no solid parts, ignoring

     
  • Anonymous

    Anonymous - 2012-10-09
    • status: pending-accepted --> open-accepted
     
  • Sean Morrison

    Sean Morrison - 2012-10-09

    That's because they lie. It's really a .tgz file. The opensourceecology.org folks named the files odd. Unpack it and the data is there. STL data is a pain to deal with as it's a lowest common denominator format, but something like this should get you going:

    mv CEBIV.stl CEBIV.stl.tar.gz
    tar zxvf CEBIV.stl.tar.gz
    mv STL CEBIV.STL
    cd CEBIV.STL
    rm -f cebiv.g
    j=0
    for i in *.STL ; do
    printf "\nOBJECT #%s " $j
    name="`echo $i | sed 's/.STL//g' | sed 's/ /_/g'`"
    stl-g -b -N "$name" "$i" "$name.g"
    mged cebiv.g dbconcat -s $name.g _$j
    j=`expr $j \+ 1`
    done
    mged cebiv.g g cebiv all*

    From there, you can run "mged cebiv.g" and there will be a top-level "cebiv" object that you can draw (e.g. "draw cebiv ; rt -F/dev/X -s1024").

    Basically, that script iterates over all STL files, converts them to BRL-CAD format, and adds them all to one database. For convenience, it strips the STL suffix and spaces so objects in BRL-CAD and file names make a little more sense. All said and done, you have a cebiv.g that has the geometry sans hierarchy.

    Seeing what the STL looks like, things are looking a lot better with the 3dm importer. It imported all geometry in the original 3dm file. It just didn't put the objects into position due to lacking support for instance references. I've added the item to our TODO.

     
  • Sean Morrison

    Sean Morrison - 2012-10-09
    • status: open-accepted --> pending-accepted
     
  • Anonymous

    Anonymous - 2012-10-10
    • status: pending-accepted --> open-accepted
     
  • Anonymous

    Anonymous - 2012-10-10

    Here is an update, the 3dm import worked better than I thought! I just dont know how to use brl-cad, the results are not shown when you load. the design is being show. :D

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    The design I'm seeing doesn't look right to me. Especially doesn't match the stl version.

    While converting geometry between CAD systems is always painful, note that our 3DM importer and NURBS support (and STEP) are under active development and aren't yet considered stable. We have users that have them in production use, but there are some known issues that we're working through (like slow prep, large memory footprint, limited STEP entity support, etc).

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    3dm-g import, missing instances and transformations

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    stl-g import scripted, missing hierarchy and colors but complete

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    I just attached two renderings that show the difference between the 3dm and stl imports. You can clearly identify most of the parts, but they're not in the right position and many instances (e.g., bolts in the panels) are clearly missing.

    Run "tops" to see top-level geometry. Run "draw [object]" to display an object wireframe in the graphics window. Running "rt" within mged should then render geometry being drawn in the graphics window.

     
  • Anonymous

    Anonymous - 2012-10-10

    Oh wow, thank you very much for your help! I will try our your script asap.

     
  • Anonymous

    Anonymous - 2012-10-10

    hahah, yes, that is the one that i see, the wrong one. 3dm png.

    I will be using github for the rest of this :https://github.com/h4ck3rm1k3/OSE-CEB-Press to hold the data files, will be checking in your script as well. thanks
    mike

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    You're quite welcome, Mike. I've documented a couple of the issues this data is provoking in our 3dm and step importer, so hopefully someone will get a chance to work on them. If you can code, I'll gladly help steer you in the right direction in our sources as well. It shouldn't be too hard to get either of those fully importing this data, but it will take some time for one of the existing devs to shift gears off their current priorities.

     
  • Anonymous

    Anonymous - 2012-10-10
    • status: open-accepted --> pending-accepted
     
  • Anonymous

    Anonymous - 2012-10-10
    • status: pending-accepted --> open-accepted
     
  • Anonymous

    Anonymous - 2012-10-10

    well the workaround works, lets leave this bug open until 3dm works, but it is not so important.

     
  • Sean Morrison

    Sean Morrison - 2012-10-10

    Fantastic Mike! One point of potential interest, we have a new GUI available called "archer" that will display the STL data shaded (non-wireframe) so you can spin the model around interactively. You might want to give that a try (archer cebiv.g). It's "pre-alpha" software not intended for production use, but it should work just fine for visualizing geometry.

     

Log in to post a comment.