Skip to content

kriegerin #79

Description

@stengersabrina1-spec

from OCC.Core.BRepPrimAPI import *
from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Fuse
from OCC.Core.gp import gp_Trsf, gp_Vec
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_Transform
from OCC.Display.SimpleGui import init_display

display, start_display, _, _ = init_display()

def move(shape,x,y,z):
tr = gp_Trsf()
tr.SetTranslation(gp_Vec(x,y,z))
return BRepBuilderAPI_Transform(shape,tr).Shape()

Base

base = BRepPrimAPI_MakeCylinder(30,6).Shape()

Felsen

rock = move(BRepPrimAPI_MakeSphere(18).Shape(),0,0,6)

Schädel (3 kleine Kugelstrukturen)

skull1 = move(BRepPrimAPI_MakeSphere(4).Shape(),-10,10,6)
skull2 = move(BRepPrimAPI_MakeSphere(4).Shape(),8,12,6)
skull3 = move(BRepPrimAPI_MakeSphere(4).Shape(),5,-12,6)

Beine

leg1 = move(BRepPrimAPI_MakeCylinder(4,30).Shape(),-6,3,10)
leg2 = move(BRepPrimAPI_MakeCylinder(4,30).Shape(),6,-2,10)

Torso

torso = move(BRepPrimAPI_MakeCylinder(9,30).Shape(),0,0,40)

Brustpanzer

chest = move(BRepPrimAPI_MakeSphere(10).Shape(),0,0,55)

Schultern

shoulderL = move(BRepPrimAPI_MakeSphere(6).Shape(),-11,0,62)
shoulderR = move(BRepPrimAPI_MakeSphere(6).Shape(),11,0,62)

Kopf

head = move(BRepPrimAPI_MakeSphere(6).Shape(),0,0,75)

Augen

eyeL = move(BRepPrimAPI_MakeSphere(1).Shape(),-2,4,76)
eyeR = move(BRepPrimAPI_MakeSphere(1).Shape(),2,4,76)

Mund

mouth = move(BRepPrimAPI_MakeBox(3,1,0.8).Shape(),-1.5,5,73)

Helm

helmet = move(BRepPrimAPI_MakeSphere(7).Shape(),0,0,78)

Hörner

hornL = move(BRepPrimAPI_MakeCone(2,0.3,16).Shape(),-6,0,85)
hornR = move(BRepPrimAPI_MakeCone(2,0.3,16).Shape(),6,0,85)

Arme

armR = move(BRepPrimAPI_MakeCylinder(2.5,26).Shape(),13,0,58)
armL = move(BRepPrimAPI_MakeCylinder(2.5,26).Shape(),-13,0,58)

Runenschwert

blade = move(BRepPrimAPI_MakeBox(2,45,1).Shape(),15,0,65)

Runen (kleine Gravurblöcke)

rune1 = move(BRepPrimAPI_MakeBox(0.5,2,0.5).Shape(),15.5,10,75)
rune2 = move(BRepPrimAPI_MakeBox(0.5,2,0.5).Shape(),15.5,20,80)
rune3 = move(BRepPrimAPI_MakeBox(0.5,2,0.5).Shape(),15.5,30,85)

Griff

handle = move(BRepPrimAPI_MakeCylinder(1.2,10).Shape(),15,0,60)

Schild

shield = move(BRepPrimAPI_MakeCylinder(13,3).Shape(),-20,0,65)

Schildgravur

symbol = move(BRepPrimAPI_MakeCylinder(3,1).Shape(),-20,0,70)

Fusion aller Teile

model = base
parts = [
rock, skull1, skull2, skull3,
leg1, leg2, torso, chest,
shoulderL, shoulderR,
head, eyeL, eyeR, mouth,
helmet, hornL, hornR,
armL, armR,
blade, rune1, rune2, rune3,
handle,
shield, symbol
]

for p in parts:
model = BRepAlgoAPI_Fuse(model,p).Shape()

display.DisplayShape(model, update=True)
start_display()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions