Example usage for javafx.scene.shape MeshView setScaleX

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

Introduction

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

Prototype

public final void setScaleX(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);
    meshView.setScaleY(scale);/*from www.  j a  v a2s .c om*/
    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);
        meshView.setScaleY(scale);//from  www.  jav  a2s  .  com
        meshView.setScaleZ(scale);
    }
}