Shape Property

  • babiasu

    babiasu - 2008-01-08


    Thank you for your answer in my previous question.
    I have another question.

    If I have a shape drawn, is there any way to see its property?
    for example, I've drawn sphere line

    in sph1.s sph 4 4 4 3

    is there any way to see the "4 4 4 3" property, so that I can edit it using command line?
    Because I feel it is difficult for me to edit precisely using GUI.

    Thank you very much.

    • David Loman

      David Loman - 2008-01-08

      You have several options to do precision editing.  I will try to list them from easiest to hardest:

      1)  Put the sphere into Solid Edit Mode and use the 'p' command in correlation with the geometry manipulation commands.


      a) mged> sed sph1.s;
      b) (on the GUI menu or Edit Pulldown Menu) Select 'Rotate'
      c) mged> p 0 90 0

      What the three steps above do is:
      a) puts the solid into solid edit mode
      b) enables rotation manipulation
      c) uses the 'p' command to rotate the solid 90 degrees about the Y axis.

      The 'p' command can be used with just about any Solid Edit Mode manipulation you can select.

      2) Use the Primitive Editor.  You can bring this window up by isung the EditMenu->Prim Editor.  Once up, simply type the name of the solid into the Name: textbox and hit <enter>.  Make some changes and Click Apply.  You *MAY* have to re-draw the object from the command line in order to see the changes.  Aka:

      mged> e sph1.s
      *make changes*
      mged> e sph1.s
      *make changes*
      mged> e sph1.s

      I do not have much experience with the Prim Editor.  From what exp I DO have, i can say that its a little cumbersome and can ruin your geometry in a hurry.  Stick with #1 (In my opinion)

      3) Lastly, you can edit the db information directly using 'db get' and 'db adjust.' :

      mged> db get sph1.s
      ell V {4 4 4} A {3 0 0} B {0 3 0} C {0 0 3}

      mged> db adjust sph1.s A {6 0 0}
      A {6 0 0}

      mged> db get sph1.s
      ell V {4 4 4} A {6 0 0} B {0 3 0} C {0 0 3}


      Again, this is just *MY* opinion, but #3 is the most complex to initally use, but once you get comfortable with it, it is almost as fast as #1.

      • Sean Morrison

        Sean Morrison - 2008-01-09

        Great options and explanations from Dave...  just a few comments to his examples:

        For his example 1)
        On step b) you can "select the rotate" menu option from the MGED command window (i.e. without using a mouse) using the "press command:
        press Rotate

        You can "press" any of the edit menu options -- to see the actual names of the things you can press, turn on the Faceplate and the Faceplate GUI on the Misc menu.  If it's got a space, just quote it (e.g. press "Set A,B,C").  You can run "press help" to get a list of some shorthand commands that are built in as well (e.g. press reset).  That way, you don't ever have to take your hands off of the keyboard.

        For his example 2)
        I'd second the emphasis that the primitive editor can be very dangerous to use until you know exactly what you're doing with 100% certainty and even then with extreme caution.  The primitive editor will let you do (bad) things to your geometry that will even make it not possible to open your geometry file later without fixing the mistake in a very manual and cumbersome manner.  Don't use it, I'd recommend learning to use the menus and the command-line methods.

        For his example 3)
        The "db" command part is optional, most/all of the db subcommands work on their own (e.g. get sph1.s  ... adjust sph1.s A {6 0 0} ... etc).

        Finally, another way to see the *results* of your "in" command example is to use the "l" command (that's an ell, not a one, e.g. l sph1.s).  You'll see that the sphere you created is actually stored as an ellipsoid with vertex (V) 4,4,4 and the A, B, and C vectors that define it all have length 3 since that's the radius you specified with the "in" command.  A common editing technique on the command line is to create geometry with the 'in' command, check it, 'kill' it, and then up-arrow twice to re-edit the 'in command with better values if you need to create objects precisely via trial-and-error.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks