Home
GH Sample Files
GH Python Tutorials
Rhino Assets
Books
Blog
Plugins
About
Privacy Policy
Terms of Service
Contact
© 2025 STUDIO TAMA

- `size`: float – 折り紙の一辺の長さ
- `fold_angle_deg`: float – 折り角(谷折りは正の値、単位は度)- `results`: list of `Brep` – 折られた4枚の面と中央の底面を含む折り紙モデルimport Rhino.Geometry as rg
import math
center = rg.Point3d(size / 2, size / 2, 0)
p0 = rg.Point3d(0, 0, 0)
p1 = rg.Point3d(size, 0, 0)
p2 = rg.Point3d(size, size, 0)
p3 = rg.Point3d(0, size, 0)
base_surface = rg.Brep.CreateFromCornerPoints(p0, p1, p2, p3, 0.001)
triangles = [
[center, p0, p1],
[center, p1, p2],
[center, p2, p3],
[center, p3, p0]
]
axes = [
(p0, p1),
(p1, p2),
(p2, p3),
(p3, p0)
]
angle_rad = math.radians(fold_angle_deg)
results = [base_surface]
for tri, (axis_start, axis_end) in zip(triangles, axes):
axis_dir = rg.Vector3d(axis_end - axis_start)
rotation = rg.Transform.Rotation(angle_rad, axis_dir, axis_start)
rotated_pts = [pt if pt == axis_start or pt == axis_end else rg.Point3d(pt) for pt in tri]
for i, pt in enumerate(rotated_pts):
if pt != axis_start and pt != axis_end:
pt.Transform(rotation)
rotated_pts[i] = pt
brep = rg.Brep.CreateFromCornerPoints(*rotated_pts, 0.001)
results.append(brep)License & Terms of Use
| Item | Allowed | Description |
|---|---|---|
| Integration into your projects | ○ | You are free to use the code as part of your scripts or works, whether for personal or commercial purposes. |
| Code modification & learning use | ○ | Customizing the code for your own learning or specific purposes is very welcome. |
| Sharing on SNS / showcasing | ○ | No 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 / link | Optional | Not required, but including a link to the source would be greatly appreciated. |