awv3
Version:
⚡ AWV3 embedded CAD
48 lines (37 loc) • 1.35 kB
JavaScript
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import * as THREE from 'three';
import BaseGraphics from './base';
import { setMaterialMeta } from './index';
var geometry = new THREE.CircleBufferGeometry(1, 32);
var material = new THREE.MeshBasicMaterial({
color: 0xa757d9,
side: THREE.DoubleSide,
polygonOffset: true,
polygonOffsetFactor: -3,
polygonOffsetUnits: -15
});
var Point =
/*#__PURE__*/
function (_BaseGraphics) {
_inheritsLoose(Point, _BaseGraphics);
function Point() {
var _this;
_this = _BaseGraphics.call(this) || this;
_this.localMesh = new THREE.Mesh(geometry, material.clone());
_this.localMesh.type = 'SketcherMesh';
_this.localMesh.material.meta = {};
_this.localMesh.material.meta.material = setMaterialMeta(material);
_this.add(_this.localMesh);
return _this;
}
var _proto = Point.prototype;
_proto.updateFromGeomParams = function updateFromGeomParams(geomParams) {
_BaseGraphics.prototype.updateFromGeomParams.call(this, geomParams);
this.localMesh.position.copy(geomParams.start);
this.localMesh.scale.set(geomParams.scale, geomParams.scale, 1.0); //make sure points are on top when picked by interaction
this.localMesh.position.z += 1e-6;
this.updateMetaBox();
};
return Point;
}(BaseGraphics);
export { Point as default };