discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Wish for annotate()

S
Scalpel78
Sat, Dec 6, 2014 12:25 PM

Hi,
I wish there was a function, for example, annotate("some text") which could
be used to create something like this:

http://forum.openscad.org/file/n10399/thread_drawing.png

Example of usage would be;

annotate("M4 nut pocket") cube([3,3,3]);

What do you think?

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, I wish there was a function, for example, annotate("some text") which could be used to create something like this: <http://forum.openscad.org/file/n10399/thread_drawing.png> Example of usage would be; annotate("M4 nut pocket") cube([3,3,3]); What do you think? -- View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Sat, Dec 6, 2014 1:38 PM

On 12/06/2014 01:25 PM, Scalpel78 wrote:

Hi,
I wish there was a function, for example, annotate("some text") which could
be used to create something like this:

[...]

What do you think?

Yes, that would be useful.

On 12/06/2014 01:25 PM, Scalpel78 wrote: > Hi, > I wish there was a function, for example, annotate("some text") which could > be used to create something like this: > > [...] > > What do you think? > Yes, that would be useful.
AD
Ari Diacou
Sat, Dec 6, 2014 8:11 PM

Maybe it could be done by connecting a line from the center? of the object
to the foreground of the viewing plane? Maybe this could be the start to
making the viewing pane interactable? Maybe you could move stuff around on
the viewing pane with the mouse? Or have a list mode, where all the items
were automatically listed on the right hand side of the drawing, with
automatic text scaling (so that the font would shrink as more and more
items were added). Any annotaate function should have a color variable to
it e.g. color=default (changes color based on color scheme),
color=different (each element annotated is in a different color), e.g.
color="red" (makes line and writing "red".

On Sat, Dec 6, 2014 at 8:38 AM, Torsten Paul Torsten.Paul@gmx.de wrote:

On 12/06/2014 01:25 PM, Scalpel78 wrote:

Hi,
I wish there was a function, for example, annotate("some text") which
could
be used to create something like this:

[...]

What do you think?

Yes, that would be useful.

Maybe it could be done by connecting a line from the center? of the object to the foreground of the viewing plane? Maybe this could be the start to making the viewing pane interactable? Maybe you could move stuff around on the viewing pane with the mouse? Or have a list mode, where all the items were automatically listed on the right hand side of the drawing, with automatic text scaling (so that the font would shrink as more and more items were added). Any annotaate function should have a color variable to it e.g. color=default (changes color based on color scheme), color=different (each element annotated is in a different color), e.g. color="red" (makes line and writing "red". On Sat, Dec 6, 2014 at 8:38 AM, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 12/06/2014 01:25 PM, Scalpel78 wrote: > >> Hi, >> I wish there was a function, for example, annotate("some text") which >> could >> be used to create something like this: >> > > > > [...] > > > >> What do you think? >> >> Yes, that would be useful. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
S
Scalpel78
Mon, Dec 8, 2014 5:44 PM

Should I put it up into GitHub as an issue?

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p10430.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Should I put it up into GitHub as an issue? -- View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p10430.html Sent from the OpenSCAD mailing list archive at Nabble.com.
G
GregWoods
Thu, Feb 26, 2015 11:46 AM

I'm surprised this doesn't exist - it would seem a fundamental requirement to
be able to annotate what is often a technical drawing.

I assume annotate() would mean it doesn't end up in a 3D print. How would
this be managed? Is the annotation a 3D or a 2D object?

Did this ever get raised on github, I couldn't find it?

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11781.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm surprised this doesn't exist - it would seem a fundamental requirement to be able to annotate what is often a technical drawing. I assume annotate() would mean it doesn't end up in a 3D print. How would this be managed? Is the annotation a 3D or a 2D object? Did this ever get raised on github, I couldn't find it? -- View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11781.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Thu, Feb 26, 2015 1:02 PM

I'm surprised this doesn't exist - it would seem a fundamental requirement to
be able to annotate what is often a technical drawing.

I assume annotate() would mean it doesn't end up in a 3D print. How would
this be managed? Is the annotation a 3D or a 2D object?

Did this ever get raised on github, I couldn't find it?

I don't think there's a github issue yet. Also that issue would be much more
useful if questions like the one above had already an answer or suggestion
how to handle it.

The example image might be a good starting point for finding a way how to
specify the information to get that model including the annotations.

ciao,
Torsten.

> I'm surprised this doesn't exist - it would seem a fundamental requirement to > be able to annotate what is often a technical drawing. > > I assume annotate() would mean it doesn't end up in a 3D print. How would > this be managed? Is the annotation a 3D or a 2D object? > > Did this ever get raised on github, I couldn't find it? > I don't think there's a github issue yet. Also that issue would be much more useful if questions like the one above had already an answer or suggestion how to handle it. The example image might be a good starting point for finding a way how to specify the information to get that model including the annotations. ciao, Torsten.
MK
Marius Kintel
Thu, Feb 26, 2015 3:17 PM

One key part of this feature could be that, if this doesn’t make it past preview, we have some freedom in terms of how to render it, meaning we don’t have to be pixel-perfect from version to version. That might help in terms of how we implement it.

-Marius

One key part of this feature could be that, if this doesn’t make it past preview, we have some freedom in terms of how to render it, meaning we don’t have to be pixel-perfect from version to version. That might help in terms of how we implement it. -Marius
G
GregWoods
Thu, Feb 26, 2015 3:49 PM

I'm a OpenSCAD noob (just a few hours usage), so not best qualified to offer
a solution.

Still, I have some thoughts...

The annotation needs to be kept separate from the main model, since you need
to be able to export a model without annotations.

The example code by Scalpel78

annotate("M4 nut pocket") cube([3,3,3]);

appears to show the annotation attached to an object. My suggestion is that
it would be attached to a point in space, which i'll call the "point of
interest".

How to render the text...

The simplest code I could think of to provide an annotation is:

annotate("M4 bolt", [12, 13, 15]);      //12,13,15 is the annotation's
point of interest

This code allows for different ways of rendering the annotation

Option1)  All annotations are always shown in the same 2D plane as the
user's screen (the viewport?) The problem is that annotations from different
parts of the model will soon clutter the screen. The position in the 2D
viewport would be automatic.

Option2) Each annotation has it's own 3D point position, defaulting to
[0,0,0], but the orientation is always in the same plane as the 2D viewport.
All annotations would need to add a translate().

translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]);

Option2b) Alternate method signature, with the translate built in.

annotate("M4 bolt", [12, 13, 15], [2, 3, 4]);

Option3) It could be a fully 3D object - like a cube with text on one
surface. The problem here is that as you view the model from different
angles, the text will disappear when viewed "end on" (though this could be
an advantage for some models if the annotation were orientated sensibly).
The cube size is automatic, based on the text size. Translate and/or rotate
allows us to position it like any other object.

rotate([0,180,0]) translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]);

Once the method signature is decided, it could even be an option in OpenSCAD
to decide how to render the annotations. (stay flat to the viewport, or
rotate with the model)

If font size and text colour options are required, the method signature
would be more complex.

My favourite is probably Option2, but opinions will likely differ.

I'm sure there are some experts who can help explore all these options
better than I can.

Greg

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11784.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm a OpenSCAD noob (just a few hours usage), so not best qualified to offer a solution. Still, I have some thoughts... The annotation needs to be kept separate from the main model, since you need to be able to export a model without annotations. The example code by Scalpel78 annotate("M4 nut pocket") cube([3,3,3]); appears to show the annotation attached to an object. My suggestion is that it would be attached to a point in space, which i'll call the "point of interest". How to render the text... The simplest code I could think of to provide an annotation is: annotate("M4 bolt", [12, 13, 15]); //12,13,15 is the annotation's point of interest This code allows for different ways of rendering the annotation Option1) All annotations are always shown in the same 2D plane as the user's screen (the viewport?) The problem is that annotations from different parts of the model will soon clutter the screen. The position in the 2D viewport would be automatic. Option2) Each annotation has it's own 3D point position, defaulting to [0,0,0], but the orientation is always in the same plane as the 2D viewport. All annotations would need to add a translate(). translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]); Option2b) Alternate method signature, with the translate built in. annotate("M4 bolt", [12, 13, 15], [2, 3, 4]); Option3) It could be a fully 3D object - like a cube with text on one surface. The problem here is that as you view the model from different angles, the text will disappear when viewed "end on" (though this could be an advantage for some models if the annotation were orientated sensibly). The cube size is automatic, based on the text size. Translate and/or rotate allows us to position it like any other object. rotate([0,180,0]) translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]); Once the method signature is decided, it could even be an option in OpenSCAD to decide how to render the annotations. (stay flat to the viewport, or rotate with the model) If font size and text colour options are required, the method signature would be more complex. My favourite is probably Option2, but opinions will likely differ. I'm sure there are some experts who can help explore all these options better than I can. Greg -- View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11784.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TH
Tim Hawkins
Thu, Feb 26, 2015 4:05 PM

You really dont want to do that, the last thing you want to be doing is to
have to rebuild all your annotations because you changed the size of a
dimension on some component, annotations definatly need to be anchored to
nodes in the model, after all that is what they reffer to, not some
arbitary point in space. However rendering need to be smart, and needs to
adapt to the position of the viewport etc. If you export to a medium that
does not support annotations, then by all means suppress them, but if the
medium supports them they should stay with the model.

A hide/show annotations would definatly be usefull.

On Fri, Feb 27, 2015, 00:49 GregWoods gregwoodslancs@gmail.com wrote:

I'm a OpenSCAD noob (just a few hours usage), so not best qualified to
offer
a solution.

Still, I have some thoughts...

The annotation needs to be kept separate from the main model, since you
need
to be able to export a model without annotations.

The example code by Scalpel78

annotate("M4 nut pocket") cube([3,3,3]);

appears to show the annotation attached to an object. My suggestion is that
it would be attached to a point in space, which i'll call the "point of
interest".

How to render the text...

The simplest code I could think of to provide an annotation is:

annotate("M4 bolt", [12, 13, 15]);      //12,13,15 is the annotation's
point of interest

This code allows for different ways of rendering the annotation

Option1)  All annotations are always shown in the same 2D plane as the
user's screen (the viewport?) The problem is that annotations from
different
parts of the model will soon clutter the screen. The position in the 2D
viewport would be automatic.

Option2) Each annotation has it's own 3D point position, defaulting to
[0,0,0], but the orientation is always in the same plane as the 2D
viewport.
All annotations would need to add a translate().

translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]);

Option2b) Alternate method signature, with the translate built in.

annotate("M4 bolt", [12, 13, 15], [2, 3, 4]);

Option3) It could be a fully 3D object - like a cube with text on one
surface. The problem here is that as you view the model from different
angles, the text will disappear when viewed "end on" (though this could be
an advantage for some models if the annotation were orientated sensibly).
The cube size is automatic, based on the text size. Translate and/or rotate
allows us to position it like any other object.

rotate([0,180,0]) translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]);

Once the method signature is decided, it could even be an option in
OpenSCAD
to decide how to render the annotations. (stay flat to the viewport, or
rotate with the model)

If font size and text colour options are required, the method signature
would be more complex.

My favourite is probably Option2, but opinions will likely differ.

I'm sure there are some experts who can help explore all these options
better than I can.

Greg

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-
tp10399p11784.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

You really dont want to do that, the last thing you want to be doing is to have to rebuild all your annotations because you changed the size of a dimension on some component, annotations definatly need to be anchored to nodes in the model, after all that is what they reffer to, not some arbitary point in space. However rendering need to be smart, and needs to adapt to the position of the viewport etc. If you export to a medium that does not support annotations, then by all means suppress them, but if the medium supports them they should stay with the model. A hide/show annotations would definatly be usefull. On Fri, Feb 27, 2015, 00:49 GregWoods <gregwoodslancs@gmail.com> wrote: > I'm a OpenSCAD noob (just a few hours usage), so not best qualified to > offer > a solution. > > Still, I have some thoughts... > > The annotation needs to be kept separate from the main model, since you > need > to be able to export a model without annotations. > > The example code by Scalpel78 > > annotate("M4 nut pocket") cube([3,3,3]); > > appears to show the annotation attached to an object. My suggestion is that > it would be attached to a point in space, which i'll call the "point of > interest". > > How to render the text... > > The simplest code I could think of to provide an annotation is: > > annotate("M4 bolt", [12, 13, 15]); //12,13,15 is the annotation's > point of interest > > This code allows for different ways of rendering the annotation > > Option1) All annotations are always shown in the same 2D plane as the > user's screen (the viewport?) The problem is that annotations from > different > parts of the model will soon clutter the screen. The position in the 2D > viewport would be automatic. > > Option2) Each annotation has it's own 3D point position, defaulting to > [0,0,0], but the orientation is always in the same plane as the 2D > viewport. > All annotations would need to add a translate(). > > translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]); > > Option2b) Alternate method signature, with the translate built in. > > annotate("M4 bolt", [12, 13, 15], [2, 3, 4]); > > Option3) It could be a fully 3D object - like a cube with text on one > surface. The problem here is that as you view the model from different > angles, the text will disappear when viewed "end on" (though this could be > an advantage for some models if the annotation were orientated sensibly). > The cube size is automatic, based on the text size. Translate and/or rotate > allows us to position it like any other object. > > rotate([0,180,0]) translate([2, 3, 4]) annotate("M4 bolt", [12, 13, 15]); > > Once the method signature is decided, it could even be an option in > OpenSCAD > to decide how to render the annotations. (stay flat to the viewport, or > rotate with the model) > > If font size and text colour options are required, the method signature > would be more complex. > > My favourite is probably Option2, but opinions will likely differ. > > I'm sure there are some experts who can help explore all these options > better than I can. > > Greg > > > > -- > View this message in context: http://forum.openscad.org/Wish-for-annotate- > tp10399p11784.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
G
GregWoods
Sat, Feb 28, 2015 4:23 PM

Tim,

yes you're absolutely right. I really didn't think that through. Annotations
should be attached to the object not a point in space, which takes us
straight back to Scalpel78's original suggestion of:

annotate("M4 nut pocket") cube([3,3,3]);

My 3 suggestions about how to render are still appropriate:
text rendered in 2D on the viewport plane, rendered at a 3D location but
with 2D rendering of text on the viewport plane, or a full 3D object where
the text rotates with the model.

--
View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11786.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Tim, yes you're absolutely right. I really didn't think that through. Annotations should be attached to the object not a point in space, which takes us straight back to Scalpel78's original suggestion of: annotate("M4 nut pocket") cube([3,3,3]); My 3 suggestions about how to render are still appropriate: text rendered in 2D on the viewport plane, rendered at a 3D location but with 2D rendering of text on the viewport plane, or a full 3D object where the text rotates with the model. -- View this message in context: http://forum.openscad.org/Wish-for-annotate-tp10399p11786.html Sent from the OpenSCAD mailing list archive at Nabble.com.