@@ -422,29 +422,43 @@ give correct coupler alignement.
422422
423423.. index ::
424424 single: ORTSAutoSize
425+ single: ORTSShapeBounds
425426
426427To simplify this process, and produce more reasonable dimensions for rolling stock, OR can now
427428automatically calculate the dimensions of rolling stock based on the shape file used. Enter
428429``ORTSAutoSize `` in the Wagon section of an engine or wagon to allow OR to determine
429- the width, height, and length of the rolling stock based on the dimensions of the main shape file,
430+ the width, height, and length of the rolling stock based on the bounding info of the shape file,
430431ignoring any values entered manually in the MSTS Size parameter.
431432
432- ``ORTSAutoSize `` accepts 3 (optional) arguments, default units in meters, corresponding to offsets from the
433- shape's width, height, and length respectively. For example, ``ORTSAutoSize ( 0.1m, -0.2m, -0.18m ) ``
434- would tell OR to automatically determine the wagon's dimensions from the shape file, then subsequently
435- add 0.1 meters to the width, subtract 0.2 meters from the height, and subtract 0.18 meters from the length,
436- using the resulting values to set the simulated size of the wagon. In most cases, the width and height
437- arguments can be set to 0, and the length argument adjusted to produce the desired coupler spacing. If
438- no arguments are specified (ie: ``ORTSAutoSize () `` was entered in the Wagon section) then all three
439- offsets are assumed to be 0 meters.
440-
441- Note that automatic sizing uses the nearest LOD of the main shape file and attached freight animations. LODs for further
442- distances have no effect on the automatic sizing. Freight animations using the ``ShapeHierarchy `` feature are also
443- skipped due to potential unintended behaviors. :ref: `Shape descriptor overrides <features-shape-manipulation >`
444- are also not considered at this phase, so if any changes are made in the .sd file, this feature may not provide
445- good results. This method also works best for rolling stock with standard buffers/couplers on each end.
446- Automatic sizing generally can't produce reasonable results for articulated rolling stock. And should something go
447- wrong with the shape file causing automatic sizing to fail, OR will revert to the values entered in the ``Size `` parameter.
433+ Additionally, ``ORTSAutoSize `` accepts 3 (optional) arguments, default units in meters, corresponding to
434+ offsets from the shape's width, height, and length respectively. For example,
435+ ``ORTSAutoSize ( 0.1m, -0.2m, -0.18m ) `` would tell OR to automatically determine the wagon's dimensions
436+ from the shape file or ``ORTSShapeBounds `` (see next paragraph), then subsequently add 0.1 meters to the
437+ width, subtract 0.2 meters from the height, and subtract 0.18 meters from the length, using the resulting
438+ values to set the simulated size of the wagon. In most cases, the width and height arguments can be set to
439+ 0, and the length argument adjusted to produce the desired coupler spacing. If no arguments are specified
440+ (ie: ``ORTSAutoSize () `` was entered in the Wagon section) then all three offsets are assumed to be 0 meters.
441+
442+ Inspecting the shape file to determine its size requires additional processing time, but this
443+ step can be skipped by providing the data directly with the ``ORTSShapeBounds `` parameter.
444+ Enter the minimum and maximum bounds of the shape in the format ``ORTSShapeBounds ( minX minY minZ
445+ maxX maxY maxZ ) ``, where the first 3 values give the minimum bounds (leftmost, rearmost, and lowest
446+ points) and the second 3 values give the maximum bounds (rightmost, frontmost, highest points) of the
447+ vertices in the shape, in meters by default. These 6 values can be determined automatically by shape
448+ viewing programs, saving time by only running the calculation once, at the disadvantage of not
449+ updating if the shape changes. If verbose eng/wag configuration messages are enabled, OR will also
450+ log the settings it calculated for ``ORTSShapeBounds `` when ``ORTSAutoSize `` is used.
451+
452+ Note that the automatic bounding method has further limitations that may require use of ``ORTSShapeBounds ``
453+ or prevent use of auto sizing entirely. Automatic bounding calculation uses the nearest LOD of
454+ the main shape file and attached freight animations. LODs for further distances have no effect
455+ on the automatic sizing. Freight animations using the ``ShapeHierarchy `` feature are also skipped
456+ due to potential unintended behaviors. :ref: `Shape descriptor overrides <features-shape-manipulation >`
457+ are also not considered at this phase, so if any changes are made in the .sd file, this feature may not
458+ provide good results. This method also works best for rolling stock with standard buffers/couplers on
459+ each end. Automatic sizing generally can't produce reasonable results for articulated rolling stock.
460+ And should something go wrong with the shape file causing automatic sizing to fail, OR will revert to
461+ the values entered in the ``Size `` parameter.
448462
449463Improved wagon alignment tools
450464------------------------------
@@ -478,10 +492,11 @@ of the 3D model, allowing the "physical" CoG to be entered separately from the "
478492And, for the sake of simplicity, it may be desired to just center the 3D model lengthwise
479493such that the couplers/buffers are equidistant from the centerpoint of the model. To make this
480494specific case easier, OR now includes the ``ORTSAutoCenter `` parameter. When ``ORTSAutoCenter ( 1 ) ``
481- is included in the Wagon section of an engine or wagon, OR will inspect the main shape file used by
482- the wagon to determine the exact Z value of CentreOfGravity required to re-center the shape in the
483- simulation. This will overwrite the manually entered Z component of ``CentreOfGravity ( x y z ) `` but
484- will not change the X or Y components. Should no re-centering be required, none will be applied.
495+ is included in the Wagon section of an engine or wagon, OR will use the shape bounding box given
496+ by ``ORTSShapeBounds `` or calculated automatically from the shape file to determine the exact
497+ Z value of CentreOfGravity required to re-center the shape in the simulation. This will overwrite
498+ the manually entered Z component of ``CentreOfGravity ( x y z ) `` but will not change the X or Y
499+ components. Should no re-centering be required, none will be applied.
485500
486501Some rolling stock will not align correctly when auto-centered. As with ``ORTSAutoSize ``, this
487502feature should be employed on rolling stock with standard buffers or couplers, and will
0 commit comments