Example usage for javafx.scene.shape MeshView setScaleZ

List of usage examples for javafx.scene.shape MeshView setScaleZ

Introduction

In this page you can find the example usage for javafx.scene.shape MeshView setScaleZ.

Prototype

public final void setScaleZ(double value) 

Source Link

Usage

From source file:eu.mihosoft.vrl.fxscad.MainController.java

private void setMeshScale(MeshContainer meshContainer, Bounds t1, final MeshView meshView) {
    double maxDim = Math.max(meshContainer.getWidth(),
            Math.max(meshContainer.getHeight(), meshContainer.getDepth()));

    double minContDim = Math.min(t1.getWidth(), t1.getHeight());

    double scale = minContDim / (maxDim * 2);

    meshView.setScaleX(scale);//w w  w.j a  va 2s .c om
    meshView.setScaleY(scale);
    meshView.setScaleZ(scale);
}

From source file:be.makercafe.apps.makerbench.editors.GCodeEditor.java

private void setMeshScale(MeshContainer meshContainer, Bounds t1, final MeshView meshView) {
    if (meshContainer != null) {
        double maxDim = Math.max(meshContainer.getWidth(),
                Math.max(meshContainer.getHeight(), meshContainer.getDepth()));

        double minContDim = Math.min(t1.getWidth(), t1.getHeight());

        double scale = minContDim / (maxDim * 2);

        meshView.setScaleX(scale);//from  w w  w  .j a  v a 2 s  .c  o  m
        meshView.setScaleY(scale);
        meshView.setScaleZ(scale);
    }
}