Loading TechIDaily…
Loading TechIDaily…
Sandflow / Industrial
Hosted on Hugging Face · Runtime not tested

Categories aid discovery; they are not runtime certifications.
Download the complete package with its dependencies.
Browse package on HF ↗Parametric Python program with 6 kinematic joints (UsdPhysics). Constructed for autonomous simulation and LLM synthesis.
import sand3d as s3d
import math
def manual_wheelchair():
frame = wheelchair_frame()
lrear = rear_wheel(1)
rrear = rear_wheel(-1)
lfork = caster_fork()
rfork = caster_fork()
lcw = caster_wheel()
rcw = caster_wheel()
f1 = s3d.local(frame, -90, 305, 305)
lrear = s3d.at(lrear, on=f1)
s3d.joint(class="tok-string">"left_rear_wheel_spin", lrear, f1, kind=class="tok-string">"continuous", axis=class="tok-string">"+Y")
f2 = s3d.local(frame, -90, -305, 305)
rrear = s3d.at(rrear, on=f2)
s3d.joint(class="tok-string">"right_rear_wheel_spin", rrear, f2, kind=class="tok-string">"continuous", axis=class="tok-string">"+Y")
f3 = s3d.local(frame, 280, 200, 380)
lfork = s3d.at(lfork, on=f3)
s3d.joint(class="tok-string">"left_caster_swivel", lfork, f3, kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
f4 = s3d.local(frame, 280, -200, 380)
rfork = s3d.at(rfork, on=f4)
s3d.joint(class="tok-string">"right_caster_swivel", rfork, f4, kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
f5 = s3d.local(lfork, -28, 0, -190)
lcw = s3d.at(lcw, on=f5)
s3d.joint(class="tok-string">"left_caster_wheel_spin", lcw, f5, kind=class="tok-string">"continuous", axis=class="tok-string">"+Y")
f6 = s3d.local(rfork, -28, 0, -190)
rcw = s3d.at(rcw, on=f6)
s3d.joint(class="tok-string">"right_caster_wheel_spin", rcw, f6, kind=class="tok-string">"continuous", axis=class="tok-string">"+Y")
return s3d.assembly(class="tok-string">"manual_wheelchair", frame, lrear, rrear, lfork, rfork, lcw, rcw)
def mat(ob, kind, color):
return s3d.material(ob, kind, color=color)
def box(name, dims, xyz=(0, 0, 0), rpy=(0, 0, 0), kind=class="tok-string">"steel", color=class="tok-string">"class="tok-comment">#babfc8"):
o = s3d.extrude(name, s3d.rect(dims[0], dims[1]), dims[2], both=True)
o = s3d.at(
o,
x=xyz[0],
y=xyz[1],
z=xyz[2],
rx=math.degrees(rpy[0]),
ry=math.degrees(rpy[1]),
rz=math.degrees(rpy[2]),
)
return mat(o, kind, color)
def cyl(name, r, l, xyz=(0, 0, 0), rpy=(0, 0, 0), kind=class="tok-string">"steel", color=class="tok-string">"class="tok-comment">#babfc8"):
o = s3d.extrude(name, s3d.circle(2 * r), l, both=True)
o = s3d.at(
o,
x=xyz[0],
y=xyz[1],
z=xyz[2],
rx=math.degrees(rpy[0]),
ry=math.degrees(rpy[1]),
rz=math.degrees(rpy[2]),
)
return mat(o, kind, color)
def wheelchair_frame():
steel = class="tok-string">"class="tok-comment">#babfc8"
fabric = class="tok-string">"class="tok-comment">#1a1f29"
black = class="tok-string">"class="tok-comment">#242628"
pieces = []
class="tok-comment"># tube paths are smooth approximations of the welded frame rails
pts = [
(340, 230, 930),
(260, 230, 820),
(-160, 230, 800),
(-160, 230, 540),
(80, 230, 540),
(280, 230, 460),
]
pieces.append(mat(s3d.wire(class="tok-string">"left_side_frame", s3d.spline(pts), 24), class="tok-string">"steel", steel))
pts = [
(340, -230, 930),
(260, -230, 820),
(-160, -230, 800),
(-160, -230, 540),
(80, -230, 540),
(280, -230, 460),
]
pieces.append(mat(s3d.wire(class="tok-string">"right_side_frame", s3d.spline(pts), 24), class="tok-string">"steel", steel))
for n, x, z, l in [
(class="tok-string">"front_seat_crossbar", 30, 540, 460),
(class="tok-string">"rear_seat_crossbar", -120, 540, 460),
(class="tok-string">"front_lower_crossbar", 280, 460, 500),
(class="tok-string">"push_handle_bar", 320, 930, 500),
(class="tok-string">"rear_lower_crossbar", -80, 540, 480),
]:
pieces.append(cyl(n, 12, l, (x, 0, z), (math.pi / 2, 0, 0)))
pieces += [
cyl(class="tok-string">"left_axle_support", 12, 300, (-120, 245, 420), (0, 0, 0)),
cyl(class="tok-string">"right_axle_support", 12, 300, (-120, -245, 420), (0, 0, 0)),
]
pieces += [
cyl(class="tok-string">"left_axle_stub", 14, 30, (-90, 260, 305), (math.pi / 2, 0, 0)),
cyl(class="tok-string">"right_axle_stub", 14, 30, (-90, -260, 305), (math.pi / 2, 0, 0)),
]
pieces += [
box(class="tok-string">"seat_sling", (360, 400, 14), (100, 0, 521), kind=class="tok-string">"fabric", color=fabric),
box(class="tok-string">"backrest_sling", (30, 440, 340), (-165, 0, 710), kind=class="tok-string">"fabric", color=fabric),
]
for side, y in [(class="tok-string">"left", 220), (class="tok-string">"right", -220)]:
pieces.append(cyl(side + class="tok-string">"_backrest_sleeve", 13, 220, (-160, y, 650)))
for side, y in [(class="tok-string">"left", 120), (class="tok-string">"right", -120)]:
pieces.append(cyl(side + class="tok-string">"_footrest_hanger", 10, 260, (300, y, 330)))
pieces.append(cyl(side + class="tok-string">"_footrest_support", 9, 80, (340, y, 230), (0, math.pi / 2, 0)))
pieces.append(
box(side + class="tok-string">"_footplate", (120, 100, 10), (400, y, 230), kind=class="tok-string">"plastic", color=black)
)
for side, y in [(class="tok-string">"left", 200), (class="tok-string">"right", -200)]:
pieces.append(cyl(side + class="tok-string">"_caster_receiver", 13, 80, (280, y, 420)))
return s3d.group(class="tok-string">"frame", *pieces)
def rear_wheel(side):
rubber = class="tok-string">"class="tok-comment">#141416"
metal = class="tok-string">"class="tok-comment">#d1d6de"
steel = class="tok-string">"class="tok-comment">#babfc8"
y = 30 * side
p = [
cyl(class="tok-string">"tire", 305, 35, (0, 0, 0), (math.pi / 2, 0, 0), class="tok-string">"rubber", rubber),
cyl(class="tok-string">"rim", 270, 22, (0, 0, 0), (math.pi / 2, 0, 0), class="tok-string">"aluminium", metal),
cyl(class="tok-string">"hub", 36, 60, (0, 0, 0), (math.pi / 2, 0, 0)),
]
for i, a in enumerate((0, math.pi / 3, 2 * math.pi / 3)):
p.append(box(class="tok-string">"spoke_" + str(i), (470, 6, 12), (0, 0, 0), (0, a, 0), class="tok-string">"aluminium", metal))
p.append(cyl(class="tok-string">"pushrim", 288, 6, (0, y, 0), (math.pi / 2, 0, 0)))
for i, a in enumerate((0, 2 * math.pi / 3, 4 * math.pi / 3)):
p.append(
box(
class="tok-string">"pushrim_standoff_" + str(i),
(50, 6, 6),
(205 * math.cos(a), y * 0.5, 205 * math.sin(a)),
(0, a, 0),
)
)
return s3d.group(class="tok-string">"rear_wheel", *p)
def caster_fork():
p = [
cyl(class="tok-string">"stem", 10, 100, (0, 0, -50)),
cyl(class="tok-string">"crown", 15, 18, (0, 0, -105)),
box(class="tok-string">"fork_bridge", (55, 40, 12), (-28, 0, -105)),
box(class="tok-string">"outer_leg", (12, 10, 78), (-28, 20, -150)),
box(class="tok-string">"inner_leg", (12, 10, 78), (-28, -20, -150)),
]
return s3d.group(class="tok-string">"caster_fork", *p)
def caster_wheel():
p = [
cyl(class="tok-string">"tire", 70, 30, (0, 0, 0), (math.pi / 2, 0, 0), class="tok-string">"rubber", class="tok-string">"class="tok-comment">#141416"),
cyl(class="tok-string">"rim", 52, 20, (0, 0, 0), (math.pi / 2, 0, 0), class="tok-string">"aluminium", class="tok-string">"class="tok-comment">#d1d6de"),
cyl(class="tok-string">"hub", 16, 18, (0, 0, 0), (math.pi / 2, 0, 0)),
box(class="tok-string">"spoke_bar", (90, 6, 10), kind=class="tok-string">"aluminium", color=class="tok-string">"class="tok-comment">#d1d6de"),
]
return s3d.group(class="tok-string">"caster_wheel", *p)🚀 Sand3D Modeling Engine: Open Interactive Sand3D Explorer Space ↗
Sandflow Sand3D Library; CC-BY-4.0
Hosted on Hugging Face: SZFSPC/techidaily-resourcesba1baf9d89ddf57433d7c47cb461f6d8883067a1
Revision: ba1baf9d89ddf57433d7c47cb461f6d8883067a1
licenseSHA-256:
commercialPermittedSHA-256:
notesSHA-256: