Module 7 — Transformations & Pattern Making
Thời lượng: ~4 giờ · Độ khó: Cơ bản–Trung bình
Mục tiêu: Tạo được mảng, lưới và hoa văn tham số bằng cách kết hợp transform + data list.
7.1 — Transform trong GH: Move, Rotate, Scale, Mirror
Trong GH, transform không phải lệnh bạn gõ — đó là component nhận geometry + thông số → trả về geometry đã biến đổi.
Move
Component: Move
Input: Geometry (G) + Translation Vector (T)
Output: Geometry đã dời + Transform matrix
Ví dụ: Move box theo vector {0,0,3} → box dịch lên 3 đơn vị
Tạo nhiều bản copy tại vị trí khác nhau:
Series (0, spacing, N) → list of X positions
Construct Point (X, 0, 0) → list of points
Vector 2Pt (Origin, Point) → list of vectors
Move (Geometry, Vectors) → N copies tại N vị trí
Rotate
Component: Rotate (2D trong plane)
Input: Geometry + Angle (radians!) + Plane
Lưu ý: GH dùng RADIANS, không phải degrees
Chuyển đổi: Degrees → Radians = dùng component "Radians"
Tạo N bản copy xoay đều:
Range (0 to 2π, N) → N góc đều nhau
Rotate (Geometry, Angles) → N copies quanh tâm
Scale
Component: Scale
Input: Geometry + Factor + Center Point
Factor < 1 → thu nhỏ
Factor > 1 → phóng to
Factor = 1 → không đổi
Mirror
Component: Mirror
Input: Geometry + Mirror Plane
Tạo Mirror Plane:
- YZ Plane: gương qua mặt YZ (lật trái-phải)
- Plane Through Point: gương qua plane custom
7.2 — Distribute Geometry trên Grid
Mục tiêu phổ biến nhất: đặt một module lên lưới điểm.
Lưới chữ nhật đơn giản
Number Slider "Cols" → Range (0 to Cols)
Number Slider "Rows" → Range (0 to Rows)
Number Slider "Spacing" → nhân với Range
Cross Reference (Cols × Rows) → tất cả tổ hợp tọa độ
Construct Point (X, Y, 0) → lưới điểm
Move (Geometry, Point as Vector) → geometry tại mỗi điểm
[Ảnh: Definition tạo lưới 5×5 với cross-reference]
Lưới lục giác
Grid Hexagonal component:
Input: Plane + Radius + Count (U) + Count (V)
Output: Points + Regions
Hoặc tự tạo:
Mỗi hàng lẻ dịch chuyển 0.5 × spacing → tạo offset rows
Kết hợp Dispatch + Move để offset alternate rows
7.3 — Populate Geometry
Phân bố đối tượng ngẫu nhiên hoặc theo điều kiện:
Populate 2D → điểm ngẫu nhiên trong Rectangle
Populate 3D → điểm ngẫu nhiên trong Box
Populate Geometry → điểm trên bề mặt surface/curve
Ứng dụng: Cây cối ngẫu nhiên trên khu đất, đèn theo khu vực, cột trong vùng.
7.4 — Orient — Đặt Module theo Frame
Orient là lệnh mạnh nhất để đặt geometry theo local frame (pháp tuyến surface):
Component: Orient
Input: Geometry (G) + Reference Plane (A) + Target Plane (B)
Output: Geometry đã xoay/di chuyển để khớp với Target Plane
Công thức tư duy:
- Reference Plane = "đây là frame gốc của geometry"
- Target Plane = "tôi muốn đặt nó theo frame này"
Workflow phổ biến: Panel theo pháp tuyến surface
Divide Surface → Surface Frames (Planes)
Rectangle (tạo ở XY Plane — Reference Plane)
Orient (Rectangle, XY Plane, Surface Frames) → Rectangle trên surface
Extrude → Panels
[Ảnh: Rectangle được đặt trên surface cong với Orient, mỗi panel theo pháp tuyến cục bộ]
7.5 — Array dọc theo Curve
Đây là kỹ thuật tạo structure dọc theo đường cong (tay vịn, cột hàng rào, dầm...):
Divide Curve (N) → Points + Tangent Vectors
Construct Plane (origin=Points, Z=Tangent) → Planes tại mỗi điểm
Cross Section (vd: Rectangle) ở XY Plane
Orient (Cross Section, XY, Curve Planes) → Extruded along curve
Thêm rotation theo index:
Series (0, step_angle, N) → Angles
Rotate (Geometry, Angles, Curve Planes) → Xoay dần theo đường cong
7.6 — Biến đổi mỗi Instance theo Index
Kỹ thuật mạnh: dùng index trong list để điều khiển từng instance khác nhau:
List Length = N
Series (0, 1, N) → indices {0, 1, 2, ..., N-1}
Divide (indices, N-1) → {0, 0.1, 0.2, ..., 1.0} (normalized)
Graph Mapper (hoặc function) → custom values
Scale (Geometry, Values) → geometry nhỏ dần hoặc theo pattern
Ứng dụng: Dãy cột cao dần từ trái sang phải:
Series → normalize → Remap (1 to 5) → Scale Column Heights
[Ảnh: Dãy cột với chiều cao tăng dần theo index, điều chỉnh bằng slider min/max]
Bài tập Module 7 — Mặt Đứng Tham số
Đề bài: Xây dựng hệ mặt đứng với ô cửa sổ biến đổi theo tham số.
Sơ đồ:
Slider "Cols" + "Rows" → Grid of Frames trên Facade Surface
Slider "Window Width" + "Window Height" → Rectangle size
Slider "Rotation" → góc xoay mỗi ô
→ Ứng dụng: Rotate với angle tăng dần theo index (pattern)
Kết quả: Mặt đứng động điều chỉnh 100% bằng slider
Các bước:
- Tạo facade surface (extrude rectangle đơn giản)
Divide Surfacevới Col/Row slider- Tạo
Rectanglewindow tại mỗi frame - Thêm
Rotatevới góc thay đổi theo index (dùngSeries) Extrudepanel mỏng- Thêm
Scaleđể tạo border gap giữa các panel - Bake và kiểm tra trong Rhino Shaded view
Liên kết kiến thức
Nền tảng cần nắm
Chủ đề liên quan