Help save net neutrality! Learn more.
Close

ebms fail to ev(aluate)

2010-06-02
2013-04-22
  • Richard Uschold

    Richard Uschold - 2010-06-02

    I have tried making several ebms (Embedded Bit Maps) for some text. I always get this error: "nmg_edge(): 0 length edge"
    If I use the -d flag, ev runs through.

    Gilligan

     
  • Sean Morrison

    Sean Morrison - 2010-06-03

    The ebm will 'ev'aluate differently depending on the data in the ebm.  If you can post the ebm data up somewhere, it can be investigated further, but without it I'd only be guessing.  Maybe a bug in the ebm's tessellation or an edge-case based on the boolean recipe being ev'd.  Adding the -d flag makes it skip boolean evaluation and just draw the nmg wireframe.

     
  • Sean Morrison

    Sean Morrison - 2010-06-03

    "export" is just BRL-CAD-lingo for writing an object out to disk.  The object is "exported" to disk any time it is edited and when it's first created.

    The dbbinary command (known as the "bo" command in newer versions) is used to save binary data within a .g file.  An EBM can pull their data from a binary object or from a separate file.

    Following the EBM example at http://brlcad.org/wiki/EBM you'll notice that you probably want to invert  your image.  Non-zero values become solid material, so you probably want a black background.  Assuming that's what you want, though, the next step is to create the EBM in mged:

    mged> in test.ebm ebm TestTwoCurves122x28.bw 122 28 10
    mged> e test.ebm
    mged> rt

    That should do the trick.

    Cheers!
    Sean

     
  • Richard Uschold

    Richard Uschold - 2010-06-03

    I was trying to export the test.ebm data to an external file to post it. What command do I use for that?

    The image is fine. I want the lettering to be recessed in the surface, rather than raised from it. Of course, the extrusion depth will be much less than the 10 you specified.
    These work fine:
    mged> in test.ebm ebm TestTwoCurves122x28.bw 122 28 10
    mged> e test.ebm
    mged> rt

    This fails:
    mged> ev test.ebm
    /test.ebm:
    didn't find trapezoid for hole-start point at:
    59 16 254
    nmg_stash_model_to_file('tri_lone_hole.g', x70fb930, lone hole start)
    nmg_stash_model_to_file(): wrote error.s to 'tri_lone_hole.g'

    bombing

    1WARNING: Triangulation of /test.ebm failed!!!

    Can you do the "ev test.ebm" command without errors?

    Gilligan

     
  • Sean Morrison

    Sean Morrison - 2010-06-04

    You missed reading my third paragraph response..  I explained that you probably had your image wrong and would need to invert it.  That's why it was "recessed" instead of "raised".  The depth was just an example to show it's working.  You'd still want to put the object in a combination and scale/translate/rotate it appropriately for your scene.

    Any objects in your .g geometry file can be exported to an external file using the "keep" command or via the GUI menu File -> Export -> Database Objects.  As .g files are generally very small to begin with, you could possibly even just post your entire .g file unless you have a very large/detailed mode.

    As for the 'ev' command, it has known complexity-of-algorithm robustness problems that can cause it to fail.  Running 'rt' or 'rtedge' are generally the more preferred method for visualization beyond the default wireframe.  Alternatively, you can try running the 'E' command instead of 'ev' or try passing options to ev/E such as -n or -d.

    Cheers!
    Sean

     
  • Richard Uschold

    Richard Uschold - 2010-06-04

    Actually, RECESSED IS what I want! But that's not important.

    I guess the keep command is the one I was looking for.

    I noticed that rt works OK. But I need ev and facetize to work too. I need the BOT generated by facetize to export. I don't want JUST a picture!

    Gilligan

     
  • Sean Morrison

    Sean Morrison - 2010-06-04

    Ah, that's good then.. misunderstood you.  Note that an alternative primitive you can use for similar raised or recessed text is the DSP (displacement map) height field primitive.  That object type takes network-order unsigned short int data (man cv) but provides the added flexibility of allowing variable heights.

    Sounds like you have things under control!  Feel free to post updates on your project and progress!  Sounds interesting.

    Cheers!
    Sean

     
  • Richard Uschold

    Richard Uschold - 2010-06-04

    All is not good. You keep missing the REAL problem! As I posted in post 5) the "ev test.ebm" command bombs.

    Also, "facetize test.emb" also bombs with nearly the same error message. Worse, the facetize command causes mged to HANG, i.e., ALL inputs are ignored, can't even quit mged with the window quit button. I have to use a separate terminal window, get the process id with the ps command then use the kill command.

    I really need ev and facetiize to run without bombing or crashing mged!

    Can YOU get the ev and facetize commands to run correctly with this "test.ebm"?

    Gilligan

     
  • Sean Morrison

    Sean Morrison - 2010-06-08

    Half-missing and half-distracted.. :)  Sorry that this is frustrating for you.  Changing across geometry representation formats (such as facetizing into polygons) isn't something that's robust for most CAD systems, and BRL-CAD is no exception.  Moreover, tessellating an EBM is a path that I'm sure is rarely ever used, so you've undoubtedly encountered a bug.

    As it certainly sounds like you've run into a bug with the facetize command on your ebm, the next step is to get some debugging diagnostic information.  If you have any *-bomb.log files, those would be useful to get posted to our bug tracker.  I'd not yet had a build of BRL-CAD ready where I could test the ev command on your data myself (as I'm running a dev build at the moment with a lot of changes).

    I'll see if I can get a test in today or tomorrow on your data to pinpoint the cause (and then hopefully develop a fix).  What version are you running now?  Since you didn't have the 'bo' command, there's a slim chance that you'll have better luck updating to the latest SVN sources.  That way even if it doesn't work, you can get the update as soon as it is made.

    Cheers!
    Sean

     
  • Richard Uschold

    Richard Uschold - 2010-06-08

    Sean,

      It occurred to me, that this may well be the same basic problem that I reported as: " (pipe - box) fails"
    Not that I know how the ebm algorithm makes faces, but it may well generate many co-planer adjacent faces, as failed in the above bug. Of course, it could be something else entirely.

    I'm running the latest available for the Mac OS X, 7.12.2

    The other day, I deleted a bunch of those bomb files, after I noticed their existence. I can can create another one, if you need one.

    Gilligan

     
  • Sean Morrison

    Sean Morrison - 2010-06-08

    It's almost certainly related to generating coplanar adjacent faces, though in this context it should be able to generate them correctly (as it's just a high count n-manifold, which should be fine).  There's no boolean involved, so it is at least limited to the primitives support for tessellation.  It might, however, be something as simple as a post-validation failing.

    Do you notice a file named tri_lone_hole.g getting generated?  That may have a partial tessellation in it if it bombed out.  A bomb log would be helpful.

     

Log in to post a comment.