Show axes of stl file

Hi, how can we view axes of a stl file? Can we create axes on some position, so that we can display user frame coordinate system.

There is the AxesHelper, if it is what I think you’re looking for, add it the root object of your Stl scene it should orient itself in the direction of that object.

I tired the same, it isn’t working… I hope i am doing correctly

var bmaterial = new THREE.MeshPhongMaterial( { color: 0x0e2045, specular: 0x111111, shininess: 200, opacity: .8, transparent: true } );
	loader.load( './model/bottomC.stl', function ( geometry ) {
	var bottomf = new THREE.Mesh( geometry, bmaterial );
		bottomf.castShadow = true;
		bottomf.receiveShadow = true;
		sys.add(bottomf);
	});

const axesHelper = new THREE.AxesHelper( 2);
sys.add( axesHelper );

If you want the orientation of the bottomf object, add the AxesHelper to it, also check the scale of that object, may be it’s too big and it’s hiding the axes object inside, set the axes first param accordingly.

The code should look like this

var bmaterial = new THREE.MeshPhongMaterial({
  color: 0x0e2045,
  specular: 0x111111,
  shininess: 200,
  opacity: 0.8,
  transparent: true,
});

loader.load("./model/bottomC.stl", function (geometry) {
  var bottomf = new THREE.Mesh(geometry, bmaterial);
  bottomf.castShadow = true;
  bottomf.receiveShadow = true;

  const axesHelper = new THREE.AxesHelper(2);
  bottomf.add(axesHelper);

  sys.add(bottomf);
});
1 Like

The problem was with scaling… Thank you.

1 Like