Skip to content
View jort123123's full-sized avatar

Block or report jort123123

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
jort123123/README.md

from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox, BRepPrimAPI_MakeCylinder from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Fuse from OCC.Core.STEPControl import STEPControl_Writer, STEPControl_AsIs from OCC.Core.STLAPI import STLAPI_Writer from OCC.Core.TopoDS import TopoDS_Compound from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_Transform from OCC.Core.gp import gp_Trsf, gp_Vec

Functie om meerdere vormen samen te voegen

def fuse_shapes(shapes): result = shapes[0] for shape in shapes[1:]: result = BRepAlgoAPI_Fuse(result, shape).Shape() return result

Chassis

chassis = BRepPrimAPI_MakeBox(100, 30, 15).Shape()

Wielen

wheel_front_left = BRepPrimAPI_MakeCylinder(10, 5).Shape() wheel_front_right = BRepPrimAPI_MakeCylinder(10, 5).Shape() wheel_rear_left = BRepPrimAPI_MakeCylinder(10, 5).Shape() wheel_rear_right = BRepPrimAPI_MakeCylinder(10, 5).Shape()

Wielen positioneren

trsf_fl = gp_Trsf() trsf_fl.SetTranslation(gp_Vec(15, -10, -2)) wheel_front_left = BRepBuilderAPI_Transform(wheel_front_left, trsf_fl).Shape()

trsf_fr = gp_Trsf() trsf_fr.SetTranslation(gp_Vec(15, 40, -2)) wheel_front_right = BRepBuilderAPI_Transform(wheel_front_right, trsf_fr).Shape()

trsf_rl = gp_Trsf() trsf_rl.SetTranslation(gp_Vec(85, -10, -2)) wheel_rear_left = BRepBuilderAPI_Transform(wheel_rear_left, trsf_rl).Shape()

trsf_rr = gp_Trsf() trsf_rr.SetTranslation(gp_Vec(85, 40, -2)) wheel_rear_right = BRepBuilderAPI_Transform(wheel_rear_right, trsf_rr).Shape()

Voorvleugel

front_wing = BRepPrimAPI_MakeBox(40, 10, 3).Shape() trsf_fw = gp_Trsf() trsf_fw.SetTranslation(gp_Vec(10, 10, 12)) front_wing = BRepBuilderAPI_Transform(front_wing, trsf_fw).Shape()

Achtervleugel

rear_wing = BRepPrimAPI_MakeBox(50, 10, 5).Shape() trsf_rw = gp_Trsf() trsf_rw.SetTranslation(gp_Vec(80, 10, 15)) rear_wing = BRepBuilderAPI_Transform(rear_wing, trsf_rw).Shape()

Supports onder vleugels

support_front = BRepPrimAPI_MakeBox(5, 5, 10).Shape() trsf_sf = gp_Trsf() trsf_sf.SetTranslation(gp_Vec(28, 13, 2)) support_front = BRepBuilderAPI_Transform(support_front, trsf_sf).Shape()

support_rear = BRepPrimAPI_MakeBox(5, 5, 10).Shape() trsf_sr = gp_Trsf() trsf_sr.SetTranslation(gp_Vec(100, 13, 5)) support_rear = BRepBuilderAPI_Transform(support_rear, trsf_sr).Shape()

Alle onderdelen samenvoegen

all_parts = [chassis, wheel_front_left, wheel_front_right, wheel_rear_left, wheel_rear_right, front_wing, rear_wing, support_front, support_rear]

f1_car = fuse_shapes(all_parts)

STL exporteren

stl_writer = STLAPI_Writer() stl_writer.Write(f1_car, "f1_auto_met_supports.stl")

print("STL-bestand 'f1_auto_met_supports.stl' is succesvol aangemaakt!")

Popular repositories Loading

  1. jort123123 jort123123 Public

    Config files for my GitHub profile.

  2. rapps-db rapps-db Public

    Forked from reactos/rapps-db

    Database for the ReactOS Application Manager (rapps)