discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

individual object axes display?

K
Ken
Sun, Jan 8, 2023 11:44 PM

Whilst I think openscad is an excellent program and I can get along with
it much better than a traditional drawing program, one thing that
frustrates me greatly is the fact that each part has it's own set of
axes- once you rotate an object, the standard axes diagram in bottom
left no longer relates to that object.
As I understand it, it would be rather difficult to do it any other way,
but I still get extremely frustrated when trying to work out which way
to move an individual component once it's been rotated. Indeed,
sometimes it appears impossible to get it to move or rotate in the
direction I want it to.

Would it be possible to have an option to have a small axes display
attached to each object, that follows that object so you can see which
way a movement will actually move that particular object?

--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com/running.html
https://sstv.vk7krj.com/all_bands.html

A baby can be defined as an ego with a noise at one end and a smell at the other.
Our job as parents is to teach them to control all three.

Whilst I think openscad is an excellent program and I can get along with it much better than a traditional drawing program, one thing that frustrates me greatly is the fact that each part has it's own set of axes- once you rotate an object, the standard axes diagram in bottom left no longer relates to that object. As I understand it, it would be rather difficult to do it any other way, but I still get extremely frustrated when trying to work out which way to move an individual component once it's been rotated. Indeed, sometimes it appears impossible to get it to move or rotate in the direction I want it to. Would it be possible to have an option to have a small axes display attached to each object, that follows that object so you can see which way a movement will actually move that particular object? -- Cheers, Ken bats059@gmail.com https://vk7krj.com/running.html https://sstv.vk7krj.com/all_bands.html ---------------------------------------- A baby can be defined as an ego with a noise at one end and a smell at the other. Our job as parents is to teach them to control all three.
AM
Adrian Mariano
Sun, Jan 8, 2023 11:56 PM

This is precisely the problem that General Library of Relativity addresses,
and that  BOSL2 tries to solve using its attachments feature---not by
putting an axis on an object but by positioning objects relative to other
objects so the coordinate system is local rather than global.  You could
write an axes() module and put it next to other objects to draw local axes,
but it seems like a clumsy solution.

See:
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments
https://github.com/revarbat/BOSL2/wiki/attachments.scad

Or:
https://github.com/davidson16807/relativity.scad

On Sun, Jan 8, 2023 at 6:46 PM Ken bats059@gmail.com wrote:

Whilst I think openscad is an excellent program and I can get along with
it much better than a traditional drawing program, one thing that
frustrates me greatly is the fact that each part has it's own set of axes-
once you rotate an object, the standard axes diagram in bottom left no
longer relates to that object.
As I understand it, it would be rather difficult to do it any other way,
but I still get extremely frustrated when trying to work out which way to
move an individual component once it's been rotated. Indeed, sometimes it
appears impossible to get it to move or rotate in the direction I want it
to.

Would it be possible to have an option to have a small axes display
attached to each object, that follows that object so you can see which way
a movement will actually move that particular object?

--
Cheers, Kenbats059@gmail.comhttps://vk7krj.com/running.htmlhttps://sstv.vk7krj.com/all_bands.html

A baby can be defined as an ego with a noise at one end and a smell at the other.
Our job as parents is to teach them to control all three.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

This is precisely the problem that General Library of Relativity addresses, and that BOSL2 tries to solve using its attachments feature---not by putting an axis on an object but by positioning objects relative to other objects so the coordinate system is local rather than global. You could write an axes() module and put it next to other objects to draw local axes, but it seems like a clumsy solution. See: https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments https://github.com/revarbat/BOSL2/wiki/attachments.scad Or: https://github.com/davidson16807/relativity.scad On Sun, Jan 8, 2023 at 6:46 PM Ken <bats059@gmail.com> wrote: > Whilst I think openscad is an excellent program and I can get along with > it much better than a traditional drawing program, one thing that > frustrates me greatly is the fact that each part has it's own set of axes- > once you rotate an object, the standard axes diagram in bottom left no > longer relates to that object. > As I understand it, it would be rather difficult to do it any other way, > but I still get extremely frustrated when trying to work out which way to > move an individual component once it's been rotated. Indeed, sometimes it > appears impossible to get it to move or rotate in the direction I want it > to. > > Would it be possible to have an option to have a small axes display > attached to each object, that follows that object so you can see which way > a movement will actually move that particular object? > > -- > Cheers, Kenbats059@gmail.comhttps://vk7krj.com/running.htmlhttps://sstv.vk7krj.com/all_bands.html > ---------------------------------------- > A baby can be defined as an ego with a noise at one end and a smell at the other. > Our job as parents is to teach them to control all three. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GH
gene heskett
Mon, Jan 9, 2023 12:41 AM

On 1/8/23 18:56, Adrian Mariano wrote:

This is precisely the problem that General Library of Relativity
addresses, and that  BOSL2 tries to solve using its attachments
feature---not by putting an axis on an object but by positioning objects
relative to other objects so the coordinate system is local rather than
global.  You could write an axes() module and put it next to other
objects to draw local axes, but it seems like a clumsy solution.

See:
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments
https://github.com/revarbat/BOSL2/wiki/attachments.scad
https://github.com/revarbat/BOSL2/wiki/attachments.scad

Or:
https://github.com/davidson16807/relativity.scad
https://github.com/davidson16807/relativity.scad

On Sun, Jan 8, 2023 at 6:46 PM Ken <bats059@gmail.com
mailto:bats059@gmail.com> wrote:

 Whilst I think openscad is an excellent program and I can get along
 with it much better than a traditional drawing program, one thing
 that frustrates me greatly is the fact that each part has it's own
 set of axes- once you rotate an object, the standard axes diagram in
 bottom left no longer relates to that object.
 As I understand it, it would be rather difficult to do it any other
 way, but I still get extremely frustrated when trying to work out
 which way to move an individual component once it's been rotated.
 Indeed, sometimes it appears impossible to get it to move or rotate
 in the direction I want it to.

 Would it be possible to have an option to have a small axes display
 attached to each object, that follows that object so you can see
 which way a movement will actually move that particular object?

The order in which you do such is quite important, and a line of code
executes like hebrew, right to left, so I always put the
translate([n,n,n]) left of the rotate([n.n.n]).  Makes it much easier to
keep track of what I'm doing.

 -- 
 Cheers, Ken
 bats059@gmail.com  <mailto:bats059@gmail.com>
 https://vk7krj.com/running.html  <https://vk7krj.com/running.html>
 https://sstv.vk7krj.com/all_bands.html  <https://sstv.vk7krj.com/all_bands.html>
 ----------------------------------------
 A baby can be defined as an ego with a noise at one end and a smell at the other.
 Our job as parents is to teach them to control all three.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Cheers, Gene Heskett.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

On 1/8/23 18:56, Adrian Mariano wrote: > This is precisely the problem that General Library of Relativity > addresses, and that  BOSL2 tries to solve using its attachments > feature---not by putting an axis on an object but by positioning objects > relative to other objects so the coordinate system is local rather than > global.  You could write an axes() module and put it next to other > objects to draw local axes, but it seems like a clumsy solution. > > See: > https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments > <https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments> > https://github.com/revarbat/BOSL2/wiki/attachments.scad > <https://github.com/revarbat/BOSL2/wiki/attachments.scad> > > Or: > https://github.com/davidson16807/relativity.scad > <https://github.com/davidson16807/relativity.scad> > > > > On Sun, Jan 8, 2023 at 6:46 PM Ken <bats059@gmail.com > <mailto:bats059@gmail.com>> wrote: > > Whilst I think openscad is an excellent program and I can get along > with it much better than a traditional drawing program, one thing > that frustrates me greatly is the fact that each part has it's own > set of axes- once you rotate an object, the standard axes diagram in > bottom left no longer relates to that object. > As I understand it, it would be rather difficult to do it any other > way, but I still get extremely frustrated when trying to work out > which way to move an individual component once it's been rotated. > Indeed, sometimes it appears impossible to get it to move or rotate > in the direction I want it to. > > Would it be possible to have an option to have a small axes display > attached to each object, that follows that object so you can see > which way a movement will actually move that particular object? > The order in which you do such is quite important, and a line of code executes like hebrew, right to left, so I always put the translate([n,n,n]) left of the rotate([n.n.n]). Makes it much easier to keep track of what I'm doing. > -- > Cheers, Ken > bats059@gmail.com <mailto:bats059@gmail.com> > https://vk7krj.com/running.html <https://vk7krj.com/running.html> > https://sstv.vk7krj.com/all_bands.html <https://sstv.vk7krj.com/all_bands.html> > ---------------------------------------- > A baby can be defined as an ego with a noise at one end and a smell at the other. > Our job as parents is to teach them to control all three. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > <mailto:discuss-leave@lists.openscad.org> > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/>
NH
nop head
Mon, Jan 9, 2023 10:31 AM

It is just a matter of applying the same transformation to the things you
are trying to position together. For example if positioning screws you make
their positions relative to the object and then apply the transformation to
position the object to both. E..g.

position_object() { // translations and rotations relative to the world's
axes
object();

  position_screws()  // translations and rotations relative to the

object's axes
screws();
}

If I need to position something unrelated relative to the object. I simply
use my position_object() module to get to its local coordinate system.
position_object() is simply a module that translates and rotates it
children().

On Mon, 9 Jan 2023 at 00:41, gene heskett gheskett@shentel.net wrote:

On 1/8/23 18:56, Adrian Mariano wrote:

This is precisely the problem that General Library of Relativity
addresses, and that  BOSL2 tries to solve using its attachments
feature---not by putting an axis on an object but by positioning objects
relative to other objects so the coordinate system is local rather than
global.  You could write an axes() module and put it next to other
objects to draw local axes, but it seems like a clumsy solution.

See:
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments
https://github.com/revarbat/BOSL2/wiki/attachments.scad
https://github.com/revarbat/BOSL2/wiki/attachments.scad

Or:
https://github.com/davidson16807/relativity.scad
https://github.com/davidson16807/relativity.scad

On Sun, Jan 8, 2023 at 6:46 PM Ken <bats059@gmail.com
mailto:bats059@gmail.com> wrote:

 Whilst I think openscad is an excellent program and I can get along
 with it much better than a traditional drawing program, one thing
 that frustrates me greatly is the fact that each part has it's own
 set of axes- once you rotate an object, the standard axes diagram in
 bottom left no longer relates to that object.
 As I understand it, it would be rather difficult to do it any other
 way, but I still get extremely frustrated when trying to work out
 which way to move an individual component once it's been rotated.
 Indeed, sometimes it appears impossible to get it to move or rotate
 in the direction I want it to.

 Would it be possible to have an option to have a small axes display
 attached to each object, that follows that object so you can see
 which way a movement will actually move that particular object?

The order in which you do such is quite important, and a line of code
executes like hebrew, right to left, so I always put the
translate([n,n,n]) left of the rotate([n.n.n]).  Makes it much easier to
keep track of what I'm doing.

 --
 Cheers, Ken
 bats059@gmail.com  <mailto:bats059@gmail.com>
 https://vk7krj.com/running.html  <https://vk7krj.com/running.html>
 https://sstv.vk7krj.com/all_bands.html  <
 ----------------------------------------
 A baby can be defined as an ego with a noise at one end and a smell

at the other.

 Our job as parents is to teach them to control all three.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Cheers, Gene Heskett.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

It is just a matter of applying the same transformation to the things you are trying to position together. For example if positioning screws you make their positions relative to the object and then apply the transformation to position the object to both. E..g. position_object() { // translations and rotations relative to the world's axes object(); position_screws() // translations and rotations relative to the object's axes screws(); } If I need to position something unrelated relative to the object. I simply use my position_object() module to get to its local coordinate system. position_object() is simply a module that translates and rotates it children(). On Mon, 9 Jan 2023 at 00:41, gene heskett <gheskett@shentel.net> wrote: > On 1/8/23 18:56, Adrian Mariano wrote: > > This is precisely the problem that General Library of Relativity > > addresses, and that BOSL2 tries to solve using its attachments > > feature---not by putting an axis on an object but by positioning objects > > relative to other objects so the coordinate system is local rather than > > global. You could write an axes() module and put it next to other > > objects to draw local axes, but it seems like a clumsy solution. > > > > See: > > https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments > > <https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments> > > https://github.com/revarbat/BOSL2/wiki/attachments.scad > > <https://github.com/revarbat/BOSL2/wiki/attachments.scad> > > > > Or: > > https://github.com/davidson16807/relativity.scad > > <https://github.com/davidson16807/relativity.scad> > > > > > > > > On Sun, Jan 8, 2023 at 6:46 PM Ken <bats059@gmail.com > > <mailto:bats059@gmail.com>> wrote: > > > > Whilst I think openscad is an excellent program and I can get along > > with it much better than a traditional drawing program, one thing > > that frustrates me greatly is the fact that each part has it's own > > set of axes- once you rotate an object, the standard axes diagram in > > bottom left no longer relates to that object. > > As I understand it, it would be rather difficult to do it any other > > way, but I still get extremely frustrated when trying to work out > > which way to move an individual component once it's been rotated. > > Indeed, sometimes it appears impossible to get it to move or rotate > > in the direction I want it to. > > > > Would it be possible to have an option to have a small axes display > > attached to each object, that follows that object so you can see > > which way a movement will actually move that particular object? > > > The order in which you do such is quite important, and a line of code > executes like hebrew, right to left, so I always put the > translate([n,n,n]) left of the rotate([n.n.n]). Makes it much easier to > keep track of what I'm doing. > > -- > > Cheers, Ken > > bats059@gmail.com <mailto:bats059@gmail.com> > > https://vk7krj.com/running.html <https://vk7krj.com/running.html> > > https://sstv.vk7krj.com/all_bands.html < > https://sstv.vk7krj.com/all_bands.html> > > ---------------------------------------- > > A baby can be defined as an ego with a noise at one end and a smell > at the other. > > Our job as parents is to teach them to control all three. > > > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > <mailto:discuss-leave@lists.openscad.org> > > > > > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > Cheers, Gene Heskett. > -- > "There are four boxes to be used in defense of liberty: > soap, ballot, jury, and ammo. Please use in that order." > -Ed Howdershelt (Author, 1940) > If we desire respect for the law, we must first make the law respectable. > - Louis D. Brandeis > Genes Web page <http://geneslinuxbox.net:6309/> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Mon, Jan 9, 2023 7:58 PM

On 1/8/2023 3:44 PM, Ken wrote:

Would it be possible to have an option to have a small axes display
attached to each object, that follows that object so you can see which
way a movement will actually move that particular object?

To specifically answer your question:  What does "object" mean here? 
Each individual cube/cylinder/sphere/whatever?  There could
hypothetically be a way to put an axis on each, but in a non-trivial
project that would be a lot of axes... and in a non-trivial project you
would probably really want axes on subassemblies, and OpenSCAD has no
way to know which subassemblies would be interesting.  So, mostly, no.

Probably the easiest approach to this kind of problem is to use the "!"
modifier to work on one part at a time.  When you put an "!" on a module
invocation, you get just that component, in its own coordinate system.

At a higher level, as nophead said, visualization is a lot easier if you
keep related components "together", so that they move relative to one
another in an easy to understand way.  For instance, for the model of my
washing machine...

... the controls are positioned on a slanted surface, but that's not how
I designed them - I designed them on a simple horizontal surface...

...and then rotated and translated them together into the final position.

Finally, if you really want your own axes, it's easy enough to build a
module that will create temporary axes wherever you want them.

Start with something like this:

module axes() {
    length = 100;
    thickness = 0.2;
    color("red") cube([length,thickness,thickness], center=true);
    color("green") cube([thickness,length,thickness], center=true);
    color("blue") cube([thickness,thickness,length], center=true);
}

Now, wherever you want axes, just say "axes();".  Tick marks, labels,
and conditionally including the axes left as exercises for the reader. 
Note that the % modifier may be useful if you want the axes to be
visible permanently.

On 1/8/2023 3:44 PM, Ken wrote: > Would it be possible to have an option to have a small axes display > attached to each object, that follows that object so you can see which > way a movement will actually move that particular object? To specifically answer your question:  What does "object" mean here?  Each individual cube/cylinder/sphere/whatever?  There could hypothetically be a way to put an axis on each, but in a non-trivial project that would be a lot of axes... and in a non-trivial project you would probably really want axes on subassemblies, and OpenSCAD has no way to know which subassemblies would be interesting.  So, mostly, no. Probably the easiest approach to this kind of problem is to use the "!" modifier to work on one part at a time.  When you put an "!" on a module invocation, you get just that component, in its own coordinate system. At a higher level, as nophead said, visualization is a lot easier if you keep related components "together", so that they move relative to one another in an easy to understand way.  For instance, for the model of my washing machine... ... the controls are positioned on a slanted surface, but that's not how I designed them - I designed them on a simple horizontal surface... ...and then rotated and translated them *together* into the final position. Finally, if you really want your own axes, it's easy enough to build a module that will create temporary axes wherever you want them. Start with something like this: module axes() { length = 100; thickness = 0.2; color("red") cube([length,thickness,thickness], center=true); color("green") cube([thickness,length,thickness], center=true); color("blue") cube([thickness,thickness,length], center=true); } Now, wherever you want axes, just say "axes();".  Tick marks, labels, and conditionally including the axes left as exercises for the reader.  Note that the % modifier may be useful if you want the axes to be visible permanently.