BoundingBox — Aspose.3D FOSS for Java
Example
BoundingBox מייצג תיבה תוחמת מיושרת לציר (AABB) המוגדרת על‑ידי שני Vector3 קצוות – הממדים המינימליים והמקסימליים. היא מוחזרת על‑ידי Node.getBoundingBox() והיא משמשת לשאילתות מרחביות, סינון פרסטרום, וחישובי גודל.
Example: com.aspose.threed
import com.aspose.threed.*;Example
| Example | Example | Example | Example |
|---|---|---|---|
minimum | Vector3 | getMinimum() | הקצה עם ערכי x, y, z הקטנים ביותר |
maximum | Vector3 | getMaximum() | הקצה עם ערכי x, y, z הגדולים ביותר |
Example
| Example | סוג החזרה | Example |
|---|---|---|
merge(Vector3 point) | void | הרחב את התיבה התוחמת כך שתכלול את הנקודה הנתונה |
merge(BoundingBox other) | void | הרחב את התיבה התוחמת כך שתכיל תיבה תוחמת אחרת |
Example
import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.*;
Scene scene = Scene.fromFile("model.obj");
for (Node node : scene.getRootNode().getChildNodes()) {
BoundingBox bbox = node.getBoundingBox();
Vector3 min = bbox.getMinimum();
Vector3 max = bbox.getMaximum();
System.out.println("Node '" + node.getName() + "':");
System.out.println(" Min: " + min);
System.out.println(" Max: " + max);
System.out.println(" Size X: " + (max.x - min.x));
System.out.println(" Size Y: " + (max.y - min.y));
System.out.println(" Size Z: " + (max.z - min.z));
}