Skip to content

Instantly share code, notes, and snippets.

@mattearnshaw
Created September 27, 2017 09:11
Show Gist options
  • Save mattearnshaw/671dc1f93ec82f8626649bcf28147f2b to your computer and use it in GitHub Desktop.
Save mattearnshaw/671dc1f93ec82f8626649bcf28147f2b to your computer and use it in GitHub Desktop.
// in src/main/webapp/js/components/interface/3dCanvas/ThreeDEngine.js
create3DCylinderFromNode: function (cylNode, material, radiusMultiplier) {
+
+ if (radiusMultiplier === undefined) radiusMultiplier = 1
var bottomBasePos = new THREE.Vector3(cylNode.position.x, cylNode.position.y, cylNode.position.z);
var topBasePos = new THREE.Vector3(cylNode.distal.x, cylNode.distal.y, cylNode.distal.z);
@@ -978,6 +982,7 @@ define(['jquery'], function () {
var midPoint = new THREE.Vector3();
midPoint.addVectors(bottomBasePos, topBasePos).multiplyScalar(0.5);
+ var c = new THREE.CylinderGeometry(cylNode.topRadius * radiusMultiplier, cylNode.bottomRadius * radiusMultiplier, axis.length(), 20, 1, false);
var c = new THREE.CylinderGeometry(cylNode.topRadius, cylNode.bottomRadius, axis.length(), 20, 1, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment