Re: [sage-support] Re: Snowman

2022-01-19 Thread Samuel Lelièvre
2022-01-20 03:49 UTC, Kwankyu:
>
> As I wish that the artwork by Samuel Lelièvre is not lost, I posted it here:
>
> https://wiki.sagemath.org/art#Snowman
>
> if the author permits. If not, let me know.

Fine with me. You should add your snow person too!
Then they can keep each other company:

sage: snowies = Graphics()
sage: snowies += P.translate(0, 0,
4).scale(2).rotateZ(-pi/5).translate(0, -4, 0)
sage: snowies += snowie.rotateZ(pi/5).translate(0, 3, 0)
sage: snowies.show(frame=False)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAEcArF2aWyZW08cA_-sUgt9i7POVnntxs5q4BH7v9op2hTq4yA%40mail.gmail.com.


Re: [sage-support] Re: Snowman

2022-01-19 Thread Kwankyu
As I wish that the artwork by Samuel Lelièvre 
 is not lost, I posted it here:

https://wiki.sagemath.org/art#Snowman

if the author permits. If not, let me know.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/f5176289-37da-45e0-a698-078c7bb8bc2fn%40googlegroups.com.


Re: [sage-support] Re: Snowman

2022-01-19 Thread slelievre
2022-01-17 02:39:56 UTC, Kwankyu:
>
> After blizzard is gone,
>
> from sage.plot.plot3d.shapes import *
> P = Graphics()
> P += Sphere(.5, color='white')
> P += Sphere(1, color='white').translate(0,0,-1.2)
> P += Sphere(1.5, color='white').translate(0,0,-2.5)
> P += Sphere(.1, color='white').translate(.45,-.1,.15) + Sphere(.05, 
color='black').translate(.51,-.1,.17)
> P += Sphere(.1, color='white').translate(.45, .1,.15) + Sphere(.05, 
color='black').translate(.51, .1,.17)
> P += Cone(.1,.5, color='orange').rotateX(0).rotateY(-pi/2).translate(.3, 
0, 0)
> P.show()
>
> Exercise: add arms to the snowman.

Nice one. Here's my snowie (also missing arms).

from sage.plot.plot3d.shapes import Cone, Sphere

r_bot = 3
r_mid = 2.25
r_top = 1.75

z_bot = r_bot
z_mid = z_bot + r_bot + 1/2 * r_mid
z_top = z_mid + r_mid + 1/2 * r_top

# scale factors to shrink spheres along one axis

s_body = 3/4  # vertical scale for body
s_btns = 1/4  # horizontal scale for buttons
s_eyes = 3/4  # horizontal scale for eyes

z_bot_s = s_body * z_bot
z_mid_s = s_body * z_mid
z_top_s = s_body * z_top

nose_length = 3/2*r_top

r_button = 1/4
r_nose = 1/4
r_eye = 1/8

body_color = 'white'
button_color = 'red'
eye_color = 'black'
nose_color = 'orange'

body_bot = sphere((0, 0, z_bot), r_bot, color=body_color)
body_mid = sphere((0, 0, z_mid), r_mid, color=body_color)
body_top = sphere((0, 0, z_top), r_top, color=body_color)
body = (body_bot + body_mid + body_top).scale(1, 1, s_body)

button = Sphere(r_button, color=button_color).scale(s_btns, 1, 1)
button_bot = button.translate(r_bot, 0, z_bot_s)
button_mid = button.translate(r_mid, 0, z_mid_s)
buttons = button_bot + button_mid

eye_angle = pi/10
eye = Sphere(r_eye, color=eye_color).scale(s_eyes, 1, 1)
eye = eye.translate((r_top, 0, z_top_s))
eyes = sum(eye.rotateZ(t) for t in (-eye_angle, eye_angle))

nose = Cone(r_nose, nose_length, color=nose_color)
nose = nose.rotateY(-9/8*pi/2).translate(0, 0, z_top_s)

parts = [body, buttons, eyes, nose]
snowie = sum(parts)
snowie.show(frame=False)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/8778147b-20f5-4681-ab97-e44dd80dca58n%40googlegroups.com.