Ze Meng
← ZTools

Geometry

zTextureMappingByObjects

Per-object box texture mapping

zTextureMappingByObjects applies a native Rhino box texture mapping (channel 1, mapping type Box) to each selected object using that object’s own bounding box, instead of one box around the whole selection. Objects of different sizes and orientations each get a mapping box that fits their own geometry, so textures are not stretched. Optional random rotation and random offset make a batch of objects look less uniform.

Quick start

  1. Run zTextureMappingByObjects.
  2. Select the objects to map (surfaces, Breps or meshes).
  3. The dialog opens with a live preview of the mapping. If an object already has a box mapping, Size X / Y / Z start from its existing size instead of the default or the value the last window was closed with. Adjust MAPPING and TRANSFORMATION. Hover Alignment to see a drawing of its options.
  4. While the dialog is open, Rhino’s own mapping gizmo (the interactive handles) is shown. You can use it to look at the current mapping box.
  5. Apply confirms and keeps the mapping. Cancel discards it. Reset returns the dialog to its default settings. If the gizmo is still in the viewport afterwards, press Esc to cancel it.

MAPPING

  • Alignment: the orientation of the mapping box.

    • CPlane: the box axes follow the current construction plane exactly, with no rotation search.
    • Min BBox (default): the box Z axis always stays world Z (it does not tilt), and the tool searches in the X/Y plane for the rotation that gives the smallest plan-view area for that object.
    • Wrap: the box wraps each object’s own minimum bounding box (the same orientation as Min BBox, with the size taken from the object’s own box), so the texture stretches with the object instead of using a common size. With Wrap, the Size rows and the padlock are hidden and the window gets shorter.
  • Size X / Size Y / Size Z: the size of the mapping box, in feet (default 1 ft) in Imperial or meters (default 0.3 m) in Metric. You can type a unit suffix, for example 20cm or 8in, and it is converted to the shown unit. They override the box size each object would get from its own fit, so objects of different sizes share one texture scale instead of each being stretched (except with Wrap).

  • Padlock (on the bracket to the right of the three Size rows): unlocked by default.

    • Unlocked: X, Y and Z each take their own value.
    • Locked: the X : Y : Z proportion at the moment you click the lock is remembered. Editing any one size then moves the other two in the same proportion. To keep all three equal, type the same value in each, then lock.

    The lock state is remembered for the next time you open the tool.

TRANSFORMATION

  • Rotate (a checkbox plus an angle range, off by default): when on, each object’s mapping box is rotated randomly about the world Z axis through the center of that object’s bottom face, by an angle between the minimum and maximum of the range (0 to 360 degrees by default). It has its own seed and re-roll button.
  • Offset (a checkbox plus a distance range and three axis switches, off by default): when on, each object’s mapping box is moved randomly by a distance between the minimum and maximum of the range. The range can be negative (default -5 to 5 ft, or -1.5 to 1.5 m in Metric). The X, Y and Z switches below it can be combined freely and decide which axes move (all three on by default). One seed and one re-roll button control all three axes: re-rolling changes all of them at once, and switching one axis off does not change the result on the other two.

How the settings work together

  • Random rotation is always about the world Z axis, whatever the Alignment. Even when the Min BBox box is tilted in plan, the rotation axis does not tilt with it, so the rotation stays predictable.
  • Offset moves the texture along the mapping box’s own X, Y and Z. An axis that is switched off stays still.
  • When the padlock is locked, editing one Size changes the other two. Unlocked, each is independent.
  • The gizmo is shown once, when the dialog opens, and does not refresh when other settings change. After Apply or Cancel it may still be in the viewport. Press Esc to cancel it.
  • Wrap and Min BBox differ: with Min BBox the box size comes from Size X/Y/Z (one size for all objects, so one texture scale). With Wrap the box size comes from each object itself (the texture stretches with the object).

Good to know

  • The gizmo shown when the dialog opens is Rhino’s own interactive mapping control. It is only for viewing and fine-tuning the current box, and it does not follow later setting changes.
  • If you close the dialog without pressing Apply, all mapping changes are undone and nothing is kept on the objects.
  • The mapping is always worked out from each object’s own bounding box. Even if several objects belong to one group, each object gets its own fitted mapping box, not one large box around the whole group.
  • The existing size is read from the first selected object that has a box mapping. If you select several objects with different existing sizes, Size starts from the first one, and Apply gives all objects that same size.