/// <summary> /// Overload of Tekla's method, using an instance of <see cref="Geometry3d.OBB"/> as input parameter instead of 2 points. /// </summary> /// <param name="selector">Model object selector to select nearby objects.</param> /// <param name="box">Oriented bounding box as input.</param> /// <returns>Enumerator of model objects being near to given AABB.</returns> public static ModelObjectEnumerator GetObjectsByBoundingBox(this ModelObjectSelector selector, Geometry3d.OBB box) { var workPlaneHandler = new Model.Model().GetWorkPlaneHandler(); var currentTransformationPlane = workPlaneHandler.GetCurrentTransformationPlane(); workPlaneHandler.SetCurrentTransformationPlane(new TransformationPlane(box.Center, box.Axis0, box.Axis1)); var result = selector.GetObjectsByBoundingBox( MinPoint: new Geometry3d.Point(-box.Extent0, -box.Extent1, -box.Extent2), MaxPoint: new Geometry3d.Point(box.Extent0, box.Extent1, box.Extent2)); workPlaneHandler.SetCurrentTransformationPlane(currentTransformationPlane); return(result); }
/// <summary> /// Overload of Tekla's method, using an instance of <see cref="Geometry3d.AABB"/> as input parameter instead of 2 points. /// </summary> /// <param name="selector">Model object selector to select nearby objects.</param> /// <param name="box">Axis-aligned bounding box as input.</param> /// <returns>Enumerator of model objects being near to given AABB.</returns> public static ModelObjectEnumerator GetObjectsByBoundingBox(this ModelObjectSelector selector, Geometry3d.AABB box) { return(selector.GetObjectsByBoundingBox(box.MinPoint, box.MaxPoint)); }