STUDIO TAMA

Rhinoceros & Grasshopper Utilities

Home

GH Sample Files

GH Python Tutorials

Rhino Assets

Books

Blog

Plugins

About

Privacy Policy

Terms of Service

Contact

© 2025 STUDIO TAMA

Day 2

Z方向に並ぶルーバー

#grid#box#structure#transform
Z方向に並ぶルーバー

✅ Inputs

count     : int型     複製するルーバーの数(例:10)
spacing   : float型   Z方向の間隔(例:3.0)
width     : float型   ルーバーの幅(Xサイズ)(例:5.0)
height    : float型   ルーバーの高さ(Yサイズ)(例:1.0)
depth     : float型   ルーバーの厚み(Zサイズ)(例:0.3)
angle     : float型   各ルーバーの回転角(度)(例:15.0)

✅ Outputs

results   : List[Box] 回転・複製されたルーバー(Box)のリスト

✅ Code

import Rhino.Geometry as rg
import math

boxes = []

hx = width / 2.0
hy = height / 2.0
hz = depth / 2.0

interval_x = rg.Interval(-hx, hx)
interval_y = rg.Interval(-hy, hy)
interval_z = rg.Interval(-hz, hz)

angle_rad = math.radians(angle)

for i in range(count):
    z = i * (height + spacing)
    center = rg.Point3d(0, 0, z)

    plane = rg.Plane(center, rg.Vector3d.XAxis, rg.Vector3d.YAxis)
    plane.Rotate(angle_rad, plane.XAxis, center)

    box = rg.Box(plane, interval_x, interval_y, interval_z)
    boxes.append(box)

results = boxes
← Back to Grasshopper Python Tutorials

License & Terms of Use

ItemAllowedDescription
Integration into your projectsYou are free to use the code as part of your scripts or works, whether for personal or commercial purposes.
Code modification & learning useCustomizing the code for your own learning or specific purposes is very welcome.
Sharing on SNS / showcasingNo permission is required to share images or URLs of your works. Please feel free to showcase them!
Redistribution / republishing×Do not publish the code or files in their entirety as content on your own site or elsewhere.
Reselling as materials/programs×Do not sell the content of this site, either as-is or with only minor modifications, for a fee.
Copyright notice / linkOptionalNot required, but including a link to the source would be greatly appreciated.
Day Day 2 - Z方向に並ぶルーバー | Grasshopper Python 入門チュートリアル | STUDIO TAMA