discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

defining the points of the arc.. it doesn't work now..

GM
Gábor Magyar
Tue, Jul 2, 2024 1:27 PM

I took a very wrong way to implement it.

For the subsequent installation of the numbers on a watch face, I
would like to put pins on the symbols of the numbers and make matching
holes in the watch face.

I'm not young anymore, so I can't figure out the mathematical way to
calculate the location of the studs/holes.

Also, which library can I use to do it. If you need a library.

I don't need code, I need knowledge. :)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[code]
include <a2d/A2D.scad>;

pos=[12, 34, 46];

szamok(pos[0]    //szoveg_meret
,pos[1]    //szoveg elhelyezésének indulo szoge
,pos[2]);  //szoveg elhelyezésének sugara

module szamok(szoveg_meret, start, szoveg_sugar){
text_angle = 90;
text_size  = szoveg_meret;
text_radius = szoveg_sugar;

linear_extrude(2, convexity=5)
for (i=[start:-30:start-91])
rotate(i)
circle_text(text = "12"
, font = "Wingdings 3:Regular"
, size = text_size
, a1 = 360-text_angle
, a2 = text_angle
, radius = text_radius);

/*I know this is the wrong way
Manual attempts to place rotation.
Brrr.
And it won't be accurate, elegant, easy to use in another project.
*/

color("red")
for(z=[-146.15:30:-50])  //<---- :(
//for(x=[53:5:53])
rotate([0,0,z])
translate([48,0,2-.1])  //<---- :(
//cube(1);
cylinder(h=2, d=1, $fn=32);

color("blue")
for(z=[-146.15:30:-50])  //<---- :(
//for(x=[53:5:53])
rotate([0,0,z])
translate([56.5,0,2-.1])  //<---- :(
//cube(1);
cylinder(h=2, d=1, $fn=32);

} //module szamok()

[/code]

I took a very wrong way to implement it. For the subsequent installation of the numbers on a watch face, I would like to put pins on the symbols of the numbers and make matching holes in the watch face. I'm not young anymore, so I can't figure out the mathematical way to calculate the location of the studs/holes. Also, which library can I use to do it. If you need a library. I don't need code, I need knowledge. :) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// [code] include <a2d/A2D.scad>; pos=[12, 34, 46]; szamok(pos[0] //szoveg_meret ,pos[1] //szoveg elhelyezésének indulo szoge ,pos[2]); //szoveg elhelyezésének sugara module szamok(szoveg_meret, start, szoveg_sugar){ text_angle = 90; text_size = szoveg_meret; text_radius = szoveg_sugar; linear_extrude(2, convexity=5) for (i=[start:-30:start-91]) rotate(i) circle_text(text = "12" , font = "Wingdings 3:Regular" , size = text_size , a1 = 360-text_angle , a2 = text_angle , radius = text_radius); /*I know this is the wrong way Manual attempts to place rotation. Brrr. And it won't be accurate, elegant, easy to use in another project. */ color("red") for(z=[-146.15:30:-50]) //<---- :( //for(x=[53:5:53]) rotate([0,0,z]) translate([48,0,2-.1]) //<---- :( //cube(1); cylinder(h=2, d=1, $fn=32); color("blue") for(z=[-146.15:30:-50]) //<---- :( //for(x=[53:5:53]) rotate([0,0,z]) translate([56.5,0,2-.1]) //<---- :( //cube(1); cylinder(h=2, d=1, $fn=32); } //module szamok() [/code]
AM
Adrian Mariano
Tue, Jul 2, 2024 1:53 PM

I do not understand what exactly you are trying to do, but you could for
example make a clock like this:

include <BOSL2/std.scad>

cylinder(d=75,h=1);
up(1) color("red")
zrot_copies(n=12,sa=90,d=60,subrot=false)
text3d(str(12-$idx),thickness=1,size=6,center=true);

using the BOSL2 library, which produces this:

[image: image.png]

On Tue, Jul 2, 2024 at 9:28 AM Gábor Magyar via Discuss <
discuss@lists.openscad.org> wrote:

I took a very wrong way to implement it.

For the subsequent installation of the numbers on a watch face, I
would like to put pins on the symbols of the numbers and make matching
holes in the watch face.

I'm not young anymore, so I can't figure out the mathematical way to
calculate the location of the studs/holes.

Also, which library can I use to do it. If you need a library.

I don't need code, I need knowledge. :)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[code]
include <a2d/A2D.scad>;

pos=[12, 34, 46];

szamok(pos[0]    //szoveg_meret
,pos[1]    //szoveg elhelyezésének indulo szoge
,pos[2]);  //szoveg elhelyezésének sugara

module szamok(szoveg_meret, start, szoveg_sugar){
text_angle = 90;
text_size  = szoveg_meret;
text_radius = szoveg_sugar;

linear_extrude(2, convexity=5)
for (i=[start:-30:start-91])
rotate(i)
circle_text(text = "12"
, font = "Wingdings 3:Regular"
, size = text_size
, a1 = 360-text_angle
, a2 = text_angle
, radius = text_radius);

/*I know this is the wrong way
Manual attempts to place rotation.
Brrr.
And it won't be accurate, elegant, easy to use in another project.
*/

color("red")
for(z=[-146.15:30:-50])  //<---- :(
//for(x=[53:5:53])
rotate([0,0,z])
translate([48,0,2-.1])  //<---- :(
//cube(1);
cylinder(h=2, d=1, $fn=32);

color("blue")
for(z=[-146.15:30:-50])  //<---- :(
//for(x=[53:5:53])
rotate([0,0,z])
translate([56.5,0,2-.1])  //<---- :(
//cube(1);
cylinder(h=2, d=1, $fn=32);

} //module szamok()

[/code]


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

I do not understand what exactly you are trying to do, but you could for example make a clock like this: include <BOSL2/std.scad> cylinder(d=75,h=1); up(1) color("red") zrot_copies(n=12,sa=90,d=60,subrot=false) text3d(str(12-$idx),thickness=1,size=6,center=true); using the BOSL2 library, which produces this: [image: image.png] On Tue, Jul 2, 2024 at 9:28 AM Gábor Magyar via Discuss < discuss@lists.openscad.org> wrote: > I took a very wrong way to implement it. > > For the subsequent installation of the numbers on a watch face, I > would like to put pins on the symbols of the numbers and make matching > holes in the watch face. > > I'm not young anymore, so I can't figure out the mathematical way to > calculate the location of the studs/holes. > > Also, which library can I use to do it. If you need a library. > > I don't need code, I need knowledge. :) > > ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// > [code] > include <a2d/A2D.scad>; > > pos=[12, 34, 46]; > > szamok(pos[0] //szoveg_meret > ,pos[1] //szoveg elhelyezésének indulo szoge > ,pos[2]); //szoveg elhelyezésének sugara > > module szamok(szoveg_meret, start, szoveg_sugar){ > text_angle = 90; > text_size = szoveg_meret; > text_radius = szoveg_sugar; > > > linear_extrude(2, convexity=5) > for (i=[start:-30:start-91]) > rotate(i) > circle_text(text = "12" > , font = "Wingdings 3:Regular" > , size = text_size > , a1 = 360-text_angle > , a2 = text_angle > , radius = text_radius); > > /*I know this is the wrong way > Manual attempts to place rotation. > Brrr. > And it won't be accurate, elegant, easy to use in another project. > */ > > color("red") > for(z=[-146.15:30:-50]) //<---- :( > //for(x=[53:5:53]) > rotate([0,0,z]) > translate([48,0,2-.1]) //<---- :( > //cube(1); > cylinder(h=2, d=1, $fn=32); > > > color("blue") > for(z=[-146.15:30:-50]) //<---- :( > //for(x=[53:5:53]) > rotate([0,0,z]) > translate([56.5,0,2-.1]) //<---- :( > //cube(1); > cylinder(h=2, d=1, $fn=32); > > } //module szamok() > > [/code] > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GM
Gábor Magyar
Thu, Jul 4, 2024 11:16 AM

I already have a watch face.
There are symbols in place of the numbers, but not all 12.
The watch face has a unique pattern that must be painted by hand. If I were
to print the symbols together with the clock face,
the color scheme of the clock face pattern would be overturned. (4 color
items)
Because of this, I have to print the clock face and the symbols separately.
But since it is a clock, it is quite important that the "numbers" are
placed in the right place,
which I would like to solve by creating holes in the clock face,
and pins for fitting on the symbols (the blue-red cylinders of the main
post).

I would like to define and specify the position of these holes/pins, as
precisely and simply as possible.
In other words, I am looking for the points of a circle with a given radius
that match the position of the symbols,
or the points defined by the symbols on a circle with a given radius.

I already have a watch face. There are symbols in place of the numbers, but not all 12. The watch face has a unique pattern that must be painted by hand. If I were to print the symbols together with the clock face, the color scheme of the clock face pattern would be overturned. (4 color items) Because of this, I have to print the clock face and the symbols separately. But since it is a clock, it is quite important that the "numbers" are placed in the right place, which I would like to solve by creating holes in the clock face, and pins for fitting on the symbols (the blue-red cylinders of the main post). I would like to define and specify the position of these holes/pins, as precisely and simply as possible. In other words, I am looking for the points of a circle with a given radius that match the position of the symbols, or the points defined by the symbols on a circle with a given radius.
NH
nop head
Thu, Jul 4, 2024 11:38 AM

Place them by translating in Y by the radius and then rotating by
multiples of 360/12. E.g.

for(i = [0:11]) rotate(i * 360 /12) translate([r, 0]) rotate(-i *360 / 12)
holes.

The second rotate() is needed if you want to keep the numbers upright.

On Thu, 4 Jul 2024 at 12:16, Gábor Magyar via Discuss <
discuss@lists.openscad.org> wrote:

I already have a watch face.
There are symbols in place of the numbers, but not all 12.
The watch face has a unique pattern that must be painted by hand. If I
were to print the symbols together with the clock face,
the color scheme of the clock face pattern would be overturned. (4 color
items)
Because of this, I have to print the clock face and the symbols
separately.
But since it is a clock, it is quite important that the "numbers" are
placed in the right place,
which I would like to solve by creating holes in the clock face,
and pins for fitting on the symbols (the blue-red cylinders of the main
post).

I would like to define and specify the position of these holes/pins, as
precisely and simply as possible.
In other words, I am looking for the points of a circle with a given
radius that match the position of the symbols,
or the points defined by the symbols on a circle with a given radius.


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

Place them by translating in Y by the radius and then rotating by multiples of 360/12. E.g. for(i = [0:11]) rotate(i * 360 /12) translate([r, 0]) rotate(-i *360 / 12) holes. The second rotate() is needed if you want to keep the numbers upright. On Thu, 4 Jul 2024 at 12:16, Gábor Magyar via Discuss < discuss@lists.openscad.org> wrote: > > I already have a watch face. > There are symbols in place of the numbers, but not all 12. > The watch face has a unique pattern that must be painted by hand. If I > were to print the symbols together with the clock face, > the color scheme of the clock face pattern would be overturned. (4 color > items) > Because of this, I have to print the clock face and the symbols > separately. > But since it is a clock, it is quite important that the "numbers" are > placed in the right place, > which I would like to solve by creating holes in the clock face, > and pins for fitting on the symbols (the blue-red cylinders of the main > post). > > I would like to define and specify the position of these holes/pins, as > precisely and simply as possible. > In other words, I am looking for the points of a circle with a given > radius that match the position of the symbols, > or the points defined by the symbols on a circle with a given radius. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Thu, Jul 4, 2024 2:30 PM

The code I posted seems like it does what you want.  The children are at
the twelve center points and $idx can be used if needed to change the hole
pattern or whatever. Just change the text into code that makes your holes.
Producing the clock face was just a simple demo.

On Thu, Jul 4, 2024 at 04:16 Gábor Magyar gmagyar6@gmail.com wrote:

I already have a watch face.
There are symbols in place of the numbers, but not all 12.
The watch face has a unique pattern that must be painted by hand. If I
were to print the symbols together with the clock face,
the color scheme of the clock face pattern would be overturned. (4 color
items)
Because of this, I have to print the clock face and the symbols
separately.
But since it is a clock, it is quite important that the "numbers" are
placed in the right place,
which I would like to solve by creating holes in the clock face,
and pins for fitting on the symbols (the blue-red cylinders of the main
post).

I would like to define and specify the position of these holes/pins, as
precisely and simply as possible.
In other words, I am looking for the points of a circle with a given
radius that match the position of the symbols,
or the points defined by the symbols on a circle with a given radius.

The code I posted seems like it does what you want. The children are at the twelve center points and $idx can be used if needed to change the hole pattern or whatever. Just change the text into code that makes your holes. Producing the clock face was just a simple demo. On Thu, Jul 4, 2024 at 04:16 Gábor Magyar <gmagyar6@gmail.com> wrote: > > I already have a watch face. > There are symbols in place of the numbers, but not all 12. > The watch face has a unique pattern that must be painted by hand. If I > were to print the symbols together with the clock face, > the color scheme of the clock face pattern would be overturned. (4 color > items) > Because of this, I have to print the clock face and the symbols > separately. > But since it is a clock, it is quite important that the "numbers" are > placed in the right place, > which I would like to solve by creating holes in the clock face, > and pins for fitting on the symbols (the blue-red cylinders of the main > post). > > I would like to define and specify the position of these holes/pins, as > precisely and simply as possible. > In other words, I am looking for the points of a circle with a given > radius that match the position of the symbols, > or the points defined by the symbols on a circle with a given radius. >
JB
Jordan Brown
Thu, Jul 4, 2024 2:54 PM

On 7/4/2024 5:16 AM, Gábor Magyar via Discuss wrote:

Because of this, I have to print the clock face and the symbols
separately.
But since it is a clock, it is quite important that the "numbers" are
placed in the right place,
which I would like to solve by creating holes in the clock face,
and pins for fitting on the symbols (the blue-red cylinders of the
main post).

Pins seem like they would be both a design problem and a printability
problem.

They'd be a design problem because they would need to be positioned
individually for each symbol, to line up with where the particular
symbol has material. (For example, an O, an X, and an I couldn't all use
pins at the same points.)

They'd be a printability problem because you'd want to print the symbols
flat, which means the pins would be sticking up - thin and very very
fragile. You don't really discuss scale, but your model has d=1
cylinders, and d=1mm cylinders would be stacks of tiny donuts. I don't
like stacks smaller than 2mm, and that's still very fragile.

There are ways around those. You could design the symbols with the pins,
and then difference them out of the clock face individually. You could
print the pins separately, flat, so that they are strong, and design
holes into both the clock face and the symbols.

But mostly... why bother with pins? Design the symbols as modules. Make
them an extra millimeter or two tall, then difference them from the
clock face so that you have a custom inset for each symbol for it to lie
in, and glue them in. You don't say whether the symbols have
three-dimensionality or are just extruded 2D shapes; if they are 2D
shapes then offset() will let you enlarge them just a little bit for the
insets.

On 7/4/2024 5:16 AM, Gábor Magyar via Discuss wrote: > Because of this, I have to print the clock face and the symbols > separately. > But since it is a clock, it is quite important that the "numbers" are > placed in the right place, > which I would like to solve by creating holes in the clock face, > and pins for fitting on the symbols (the blue-red cylinders of the > main post). Pins seem like they would be both a design problem and a printability problem. They'd be a design problem because they would need to be positioned individually for each symbol, to line up with where the particular symbol has material. (For example, an O, an X, and an I couldn't all use pins at the same points.) They'd be a printability problem because you'd want to print the symbols flat, which means the pins would be sticking up - thin and very very fragile. You don't really discuss scale, but your model has d=1 cylinders, and d=1mm cylinders would be stacks of tiny donuts. I don't like stacks smaller than 2mm, and that's still very fragile. There are ways around those. You could design the symbols with the pins, and then difference them out of the clock face individually. You could print the pins separately, flat, so that they are strong, and design holes into both the clock face and the symbols. But mostly... why bother with pins? Design the symbols as modules. Make them an extra millimeter or two tall, then difference them from the clock face so that you have a custom inset for each symbol for it to lie in, and glue them in. You don't say whether the symbols have three-dimensionality or are just extruded 2D shapes; if they are 2D shapes then offset() will let you enlarge them just a little bit for the insets.
GM
Gábor Magyar
Mon, Jul 8, 2024 12:11 PM

Thanks for the code!

However, I don't understand why the r_-r_ alignment works in the case
of a cylinder,
and why not in the case of symbol?

svg_[0]-svg_[0]

The svg_ variable has the xy size of the symbol.

nop head via Discuss discuss@lists.openscad.org ezt írta (időpont:
2024. júl. 4., Cs, 13:39):

Place them by translating in Y by the radius and then rotating by multiples of 360/12. E.g.

for(i = [0:11]) rotate(i * 360 /12) translate([r, 0]) rotate(-i *360 / 12) holes.

The second rotate() is needed if you want to keep the numbers upright.

On Thu, 4 Jul 2024 at 12:16, Gábor Magyar via Discuss discuss@lists.openscad.org wrote:

I already have a watch face.
There are symbols in place of the numbers, but not all 12.
The watch face has a unique pattern that must be painted by hand. If I were to print the symbols together with the clock face,
the color scheme of the clock face pattern would be overturned. (4 color items)
Because of this, I have to print the clock face and the symbols separately.
But since it is a clock, it is quite important that the "numbers" are placed in the right place,
which I would like to solve by creating holes in the clock face,
and pins for fitting on the symbols (the blue-red cylinders of the main post).

I would like to define and specify the position of these holes/pins, as precisely and simply as possible.
In other words, I am looking for the points of a circle with a given radius that match the position of the symbols,
or the points defined by the symbols on a circle with a given radius.


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


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

Thanks for the code! However, I don't understand why the r_-r_ alignment works in the case of a cylinder, and why not in the case of symbol? svg_[0]-svg_[0] The svg_ variable has the xy size of the symbol. nop head via Discuss <discuss@lists.openscad.org> ezt írta (időpont: 2024. júl. 4., Cs, 13:39): > > Place them by translating in Y by the radius and then rotating by multiples of 360/12. E.g. > > for(i = [0:11]) rotate(i * 360 /12) translate([r, 0]) rotate(-i *360 / 12) holes. > > The second rotate() is needed if you want to keep the numbers upright. > > On Thu, 4 Jul 2024 at 12:16, Gábor Magyar via Discuss <discuss@lists.openscad.org> wrote: >> >> >> I already have a watch face. >> There are symbols in place of the numbers, but not all 12. >> The watch face has a unique pattern that must be painted by hand. If I were to print the symbols together with the clock face, >> the color scheme of the clock face pattern would be overturned. (4 color items) >> Because of this, I have to print the clock face and the symbols separately. >> But since it is a clock, it is quite important that the "numbers" are placed in the right place, >> which I would like to solve by creating holes in the clock face, >> and pins for fitting on the symbols (the blue-red cylinders of the main post). >> >> I would like to define and specify the position of these holes/pins, as precisely and simply as possible. >> In other words, I am looking for the points of a circle with a given radius that match the position of the symbols, >> or the points defined by the symbols on a circle with a given radius. >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Mon, Jul 8, 2024 6:00 PM

On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote:

However, I don't understand why the r_-r_ alignment works in the case
of a cylinder,
and why not in the case of symbol?

svg_[0]-svg_[0]

The svg_ variable has the xy size of the symbol.

More context please.  Perhaps an example snippet that demonstrates your
question?

On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote: > However, I don't understand why the r_-r_ alignment works in the case > of a cylinder, > and why not in the case of symbol? > > svg_[0]-svg_[0] > > The svg_ variable has the xy size of the symbol. More context please.  Perhaps an example snippet that demonstrates your question?
GM
Gábor Magyar
Tue, Jul 9, 2024 8:25 AM

<<code>>
svg="szimbolum_teli.svg";
svg_=[4.6, 8.67];
//svg__=[svg_[0]/2, svg_[1]/2 ];

$fn=60;

%translate([0,0,-1])
circle(d_+r_);

with_sym();

module with_sym(){
for(i = [-3:0])
rotate(i * 360 /12)
translate([svg_[0]-svg_[0], d_-svg_[1]*2])
rotate(-i *5 / 12)
//scale([1.5, 1.5, 1])
import(svg);

rotate(180)
for(i = [-3:0])
rotate(i * 360 /12)
translate([r_-r_, d_-h_*2])
rotate(-i *360 / 12)
cylinder(h=h_, r=r_);
}
<<code>>

The cylinders remain in exact position even if the diameter (size) changes.

However, the symbol created from svg does not move, not even in the
case of "any" translate.

translate([svg_[0]-svg_[0], d_-svg_[1]*2])

Where svg_variable stores the xy size of the svg image.

It works fine for a cylinder.

translate([r_-r_, d_-h_*2])

The cylinder is placed exactly on the x and y axes.

In the end, it's not a big problem, because there will be a symbol everywhere,
so it won't stand out because of the circle,
but as a problem to be solved, I'm interested in why the svg can't be
positioned exactly.

Jordan Brown openscad@jordan.maileater.net ezt írta (időpont: 2024.
júl. 8., H, 20:00):

On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote:

However, I don't understand why the r_-r_ alignment works in the case
of a cylinder,
and why not in the case of symbol?

svg_[0]-svg_[0]

The svg_ variable has the xy size of the symbol.

More context please.  Perhaps an example snippet that demonstrates your question?

<<code>> svg="szimbolum_teli.svg"; svg_=[4.6, 8.67]; //svg__=[svg_[0]/2, svg_[1]/2 ]; $fn=60; %translate([0,0,-1]) circle(d_+r_); with_sym(); module with_sym(){ for(i = [-3:0]) rotate(i * 360 /12) translate([svg_[0]-svg_[0], d_-svg_[1]*2]) rotate(-i *5 / 12) //scale([1.5, 1.5, 1]) import(svg); rotate(180) for(i = [-3:0]) rotate(i * 360 /12) translate([r_-r_, d_-h_*2]) rotate(-i *360 / 12) cylinder(h=h_, r=r_); } <<code>> The cylinders remain in exact position even if the diameter (size) changes. However, the symbol created from svg does not move, not even in the case of "any" translate. translate([svg_[0]-svg_[0], d_-svg_[1]*2]) Where svg_variable stores the xy size of the svg image. It works fine for a cylinder. translate([r_-r_, d_-h_*2]) The cylinder is placed exactly on the x and y axes. In the end, it's not a big problem, because there will be a symbol everywhere, so it won't stand out because of the circle, but as a problem to be solved, I'm interested in why the svg can't be positioned exactly. Jordan Brown <openscad@jordan.maileater.net> ezt írta (időpont: 2024. júl. 8., H, 20:00): > > On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote: > > However, I don't understand why the r_-r_ alignment works in the case > of a cylinder, > and why not in the case of symbol? > > svg_[0]-svg_[0] > > The svg_ variable has the xy size of the symbol. > > > More context please. Perhaps an example snippet that demonstrates your question?
GM
Gábor Magyar
Tue, Jul 9, 2024 9:08 AM

Gábor Magyar gmagyar6@gmail.com ezt írta (időpont: 2024. júl. 9., K, 10:25):

<<code>>
svg="szimbolum_teli.svg";
svg_=[4.6, 8.67];
//svg__=[svg_[0]/2, svg_[1]/2 ];

$fn=60;

%translate([0,0,-1])
circle(d_+r_);

with_sym();

module with_sym(){
for(i = [-3:0])
rotate(i * 360 /12)
translate([svg_[0]-svg_[0], d_-svg_[1]*2])
rotate(-i *5 / 12)
//scale([1.5, 1.5, 1])
import(svg);

rotate(180)
for(i = [-3:0])
rotate(i * 360 /12)
translate([r_-r_, d_-h_*2])
rotate(-i *360 / 12)
cylinder(h=h_, r=r_);
}
<<code>>

The cylinders remain in exact position even if the diameter (size) changes.

However, the symbol created from svg does not move, not even in the
case of "any" translate.

translate([svg_[0]-svg_[0], d_-svg_[1]*2])

Where svg_variable stores the xy size of the svg image.

It works fine for a cylinder.

translate([r_-r_, d_-h_*2])

The cylinder is placed exactly on the x and y axes.

In the end, it's not a big problem, because there will be a symbol everywhere,
so it won't stand out because of the circle,
but as a problem to be solved, I'm interested in why the svg can't be
positioned exactly.

Jordan Brown openscad@jordan.maileater.net ezt írta (időpont: 2024.
júl. 8., H, 20:00):

On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote:

However, I don't understand why the r_-r_ alignment works in the case
of a cylinder,
and why not in the case of symbol?

svg_[0]-svg_[0]

The svg_ variable has the xy size of the symbol.

More context please.  Perhaps an example snippet that demonstrates your question?

Gábor Magyar <gmagyar6@gmail.com> ezt írta (időpont: 2024. júl. 9., K, 10:25): > > <<code>> > svg="szimbolum_teli.svg"; > svg_=[4.6, 8.67]; > //svg__=[svg_[0]/2, svg_[1]/2 ]; > > $fn=60; > > %translate([0,0,-1]) > circle(d_+r_); > > > with_sym(); > > module with_sym(){ > for(i = [-3:0]) > rotate(i * 360 /12) > translate([svg_[0]-svg_[0], d_-svg_[1]*2]) > rotate(-i *5 / 12) > //scale([1.5, 1.5, 1]) > import(svg); > > > rotate(180) > for(i = [-3:0]) > rotate(i * 360 /12) > translate([r_-r_, d_-h_*2]) > rotate(-i *360 / 12) > cylinder(h=h_, r=r_); > } > <<code>> > > The cylinders remain in exact position even if the diameter (size) changes. > > However, the symbol created from svg does not move, not even in the > case of "any" translate. > > translate([svg_[0]-svg_[0], d_-svg_[1]*2]) > > Where svg_variable stores the xy size of the svg image. > > It works fine for a cylinder. > > translate([r_-r_, d_-h_*2]) > > The cylinder is placed exactly on the x and y axes. > > In the end, it's not a big problem, because there will be a symbol everywhere, > so it won't stand out because of the circle, > but as a problem to be solved, I'm interested in why the svg can't be > positioned exactly. > > Jordan Brown <openscad@jordan.maileater.net> ezt írta (időpont: 2024. > júl. 8., H, 20:00): > > > > On 7/8/2024 5:11 AM, Gábor Magyar via Discuss wrote: > > > > However, I don't understand why the r_-r_ alignment works in the case > > of a cylinder, > > and why not in the case of symbol? > > > > svg_[0]-svg_[0] > > > > The svg_ variable has the xy size of the symbol. > > > > > > More context please. Perhaps an example snippet that demonstrates your question?