Beispiel #1
0
# read transform from attribute and set anchor
anchorOptions = { 'addTo': I }

anchor = Anchor(**anchorOptions)

# circle
Ellipse(
    addTo=anchor,
    diameter=80,
    translate={ 'z' : -40 },
    stroke=20,
    color=eggplant,
)

# triangle
Shape(
    addTo=anchor,
    path=[
        { 'x' :   0, 'y' : -32 },
        { 'x' :  32, 'y' :  32 },
        { 'x' : -32, 'y' :  32 },
    ],
    translate={ 'z' : 40 },
    color=orange,
    stroke=12,
    fill=True)

I.showInterface()
I.updateRenderGraph()
Beispiel #2
0
    'depth': D,
    'topFace': yellow,
    'rearFace': gold,
    'leftFace': orange,
    'rightFace': orange,
    'frontFace': garnet,
    'bottomFace': eggplant,
}

Box(translate={'y': -D}, **boxOptions)  # top    # bottomFace=False
Box(translate={'y': D}, **boxOptions)  # bottom # topFace=False
Box(translate={'z': D}, **boxOptions)  # front  # rearFace=False
Box(translate={'z': -D}, **boxOptions)  # back   # frontFace
Box(translate={'x': D}, **boxOptions)  # left   # rightFace=False
Box(translate={'x': -D}, **boxOptions)  # right  # leftFace=False

dotOptions = {
    'addTo': model,
    'stroke': D,
}

Shape(translate={'y': -D * 2}, color=gold, **dotOptions)
Shape(translate={'y': D * 2}, color=gold, **dotOptions)
Shape(translate={'x': -D * 2}, color=yellow, **dotOptions)
Shape(translate={'x': D * 2}, color=garnet, **dotOptions)
Shape(translate={'z': -D * 2}, color=orange, **dotOptions)
Shape(translate={'z': D * 2}, color=eggplant, **dotOptions)

I.showInterface()
I.updateRenderGraph()
Beispiel #3
0
start = {'x': -60, 'y': -60}
startControl = {'x': 20, 'y': -60}
endControl = {'x': -20, 'y': 60}
end = {'x': 60, 'y': 60}

I = Illustration()
I.setSize(200, 200)

# curve
Shape(
    addTo=I,
    path=[
        start,
        {
            'bezier': [startControl, endControl, end]
        },
    ],
    closed=False,
    stroke=20,
    color=eggplant,
)

# control points
controlDot = Shape(
    addTo=I,
    translate=startControl,
    stroke=12,
    color=orange,
)
controlDot.copy(translate=endControl, )
Beispiel #4
0
from zDogPy.vector import Vector
from zDogPy.shape import Shape
from zDogPy.illustration import Illustration

I = Illustration()
I.setSize(24, 24)

D = 5
S = 3

origin = Anchor(addTo=I, scale=3)
dotOptions = dict(addTo=origin, stroke=S, color=(1, 0, 0, 0.5))

# Shape(translate={ 'x':  0, 'y' :  0, 'z':  0 }, **dotOptions)

Shape(translate={ 'x':  D, 'y' :  D, 'z':  D }, **dotOptions)
Shape(translate={ 'x': -D, 'y' :  D, 'z':  D }, **dotOptions)
Shape(translate={ 'x':  D, 'y' : -D, 'z':  D }, **dotOptions)
Shape(translate={ 'x': -D, 'y' : -D, 'z':  D }, **dotOptions)

Shape(translate={ 'x':  0, 'y' :  D, 'z':  D }, **dotOptions)
Shape(translate={ 'x':  0, 'y' : -D, 'z':  D }, **dotOptions)
Shape(translate={ 'x':  0, 'y' :  D, 'z': -D }, **dotOptions)
Shape(translate={ 'x':  0, 'y' : -D, 'z': -D }, **dotOptions)

Shape(translate={ 'x':  D, 'y' :  D, 'z': -D }, **dotOptions)
Shape(translate={ 'x': -D, 'y' :  D, 'z': -D }, **dotOptions)
Shape(translate={ 'x':  D, 'y' : -D, 'z': -D }, **dotOptions)
Shape(translate={ 'x': -D, 'y' : -D, 'z': -D }, **dotOptions)

Shape(translate={ 'x':  D, 'y' :  0, 'z': -D }, **dotOptions)
Beispiel #5
0
I.setSize(60, 60)

# lines
S1 = Shape(addTo=I,
           path=[
               {
                   'x': -6,
                   'y': -6
               },
               {
                   'x': 6,
                   'y': -6
               },
               {
                   'x': 6,
                   'y': 6
               },
               {
                   'x': -6,
                   'y': 6
               },
           ],
           translate={
               'x': -12,
               'y': -12
           },
           closed=False,
           color=eggplant,
           stroke=2)

# move
S2 = Shape(addTo=I,