I have created a new visual representation demonstrating the guidelines for length and diameter of a cylinder.
Successfully positioning the line for the length, I now need to figure out how to adjust the properties of the line in order to draw a straight line representing the diameter as shown in the provided example:
// Creating a line to represent the diameter
var diameterLineGeometry = new THREE.Geometry();
var diameterVertArray = diameterLineGeometry.vertices;
diameterVertArray.push(new THREE.Vector3(1, 0.5, 0), new THREE.Vector3(-0.3, 0.7, 1));
diameterLineGeometry.computeLineDistances();
var diameterLineMaterial = new THREE.LineBasicMaterial({
color: 0xcc0000
});
var diameterLine = new THREE.Line(diameterLineGeometry, diameterLineMaterial);
cylinder.add(diameterLine);
An issue I am encountering with this code is that when I modify the size of the cylinder object, the position of the lines shifts. The line positions accurately reflect the dimensions when the object is small, e.g. 50 x 40. However, if I adjust the dimensions to something larger like "123x123," the line positions become inconsistent.
Here is the link to view the visual representation on JSFiddle: http://jsfiddle.net/b9ge6fr6/7/
If you require additional information or have any suggestions, please let me know.
Please provide your feedback and recommendations. Thank you.