Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

revolve and translation

Help
2011-02-17
2013-04-22
  • when I try to apply to a revolve a translation with oed mged say: transform_editing_solid failed to apply a matrix transform, aborting
    How can I do ?
    Thanks feffe050274

     
  • Sean Morrison
    Sean Morrison
    2011-02-18

    Can you provide an exact transcript that reproduces the error?  A simple script that creates some geometry, runs oed, and then the matrix edit you're attempting to apply should be sufficient.  Any action you perform with the GUI can be performed on the command line, but if you don't know the command-line command, just state exactly what GUI steps are needed and the values you use on input forms so we can try to reproduce the issue and investigate.

    One possible reason is that you're attempting to apply a shearing matrix, which is not allowed.  Another possibility might be a non-uniform scale.

    Cheers!
    Sean

     
  • To test it is quite easy:
    open mged and create a new database. then input this 3 comands:
    put {ske} sketch V {1 1 0} A {1 0 0} B {0 1 0} VL { {1 1} {2 1} {2 2} } SL { { line S 0 E 1 } { line S 1 E 2 } { line S 2 E 0 } }
    put {rev} revolve V {2 0 0}  axis {1 0 0}  R {0 0 1}  ang 1.5 sk_name ske
    draw *
    then try to translate the solid "rev" or any region with it inside or any comb with it inside. I'm trying to use oed or the mged facilities but the error is always the same:
    transform_editing_solid failed to apply a matrix transform, aborting.
    Same results with command line. I think it's a problem of the revolve solid.

    Thanks, Federico (feffe050274).

     
  • Sean Morrison
    Sean Morrison
    2011-02-22

    Ah, revolve!  That makes much more sense then…  The revolve primitive is one of the newest to be implemented and, as such, unfortunately doesn't yet have support for matrix transformations implemented.  That said, I believe you should be able to put the revolve into a container combination and apply matrix transforms on the comb.  You might have to "double-bag it" for it to work, but I've not tested it myself.

    I am, however, testing a modification right now that should implement matrix transforms for revolve.  Stay tuned!

     
  • It's OK.
    If you need some help in coding it, you can tell me which are the source files involved in it.
    Or if you don't need help in coding, tell me something, i'll happy to make extensive tests of your code.
    Revolve is a powerfull primitive and is really needed in meccanical modellation.

    Thank you very much, Federico.

     
  • Sean Morrison
    Sean Morrison
    2011-02-24

    Help coding is always welcome  Fantastic offer!

    The source code for revolve is in src/librt/primitives/revolve/revolve.c

    The function that's missing is an rt_revolve_xform(), which gets added to that file.

    Then that callback gets listed in src/librt/primitives/table.c

    Look for ID_REVOLVE and you'll see a NULL line above rt_revolve_parse() that will get changed to the transformation function.  What hasn't been tested and might just work, is just using rt_generic_xform() instead of writing an rt_revolve_parse() function, so that's something you can easily try.

    If it fails, though, then you'll want to implement something similar to the rt_extrude_xform() in src/librt/primitives/extrude/extrude.c

    Feel free to ask any questions if you get stuck on something.  If you'd like some interactive discussion, several developers are available on IRC most times of day, #brlcad on irc.freenode.net.

    Cheers!
    Sean

     
  • Sean Morrison
    Sean Morrison
    2011-03-01

    Just a quick status update, I confirmed that merely setting rt_generic_xform() as the transformation callback by itself is not sufficient.  At a minimum, the wireframe plot and raytrace get messed up implying a custom routine similar to rt_extrude_xform() is needed at a minimum.

    Cheers!
    Sean

     
  • Dongxu Li
    Dongxu Li
    2011-03-11

    patch to implement rt_revolve_xform()

    http://paste.pocoo.org/show/351832/

    it works for me, and more testing is needed.

     
  • Sean Morrison
    Sean Morrison
    2011-03-11

    That is awesome, you and another guy finished at nearly the same time with very similar (but not identical) implementations.  I'll work on figuring out the differences and merging the two together.

     
  • Sean Morrison
    Sean Morrison
    2011-03-11

    OOPS, I just realized that you ARE the "other guy" .. so the changes I take it are fixes you made to your original version?  Still awesome, thanks dli!

     
  • Sean Morrison
    Sean Morrison
    2011-03-11

    Patch applied to the latest sources and should be in the upcoming 7.18.4 release.

     
  • Very Good,
    I'm going to recompile it and test it.
    Then I'll put in a production environment for a testing consolidation.
    I'll give you some feedback.
    Thanks, Federico.

     
  • It's still quite buggy. Some times mged crash or the wireframe has strange shapes moving/rotating the revolve primitive.
    I'll look at the code,
    Bye.