attach sketch to SolidMesh

This commit is contained in:
Val Erastov 2015-01-08 21:31:27 -08:00
parent c8503da9c6
commit aa085d1c7e
3 changed files with 4 additions and 6 deletions

View file

@ -126,7 +126,6 @@ TCAD.utils.equal = function(v1, v2) {
TCAD.utils.sketchToPolygons = function(geom) {
var dict = {};
var points = {};
var lines = geom.lines;
function key(a) {
@ -153,7 +152,7 @@ TCAD.utils.sketchToPolygons = function(geom) {
memDir(b, a);
}
graph = {
var graph = {
id : key,
@ -168,7 +167,7 @@ TCAD.utils.sketchToPolygons = function(geom) {
size : function() {
return points.length;
},
}
};
var loops = TCAD.graph.finaAllLoops(graph);
@ -337,9 +336,9 @@ TCAD.SketchFace.prototype.syncSketches = function(geom) {
for (var i = this.sketch3DGroup.children.length - 1; i >= 0; --i) {
this.sketch3DGroup.remove(this.sketch3DGroup.children[i]);
}
} else {
this.sketch3DGroup = new THREE.Object3D();
this.solid.meshObject.add(this.sketch3DGroup);
}
this.geom = [];

View file

@ -18,7 +18,6 @@ TCAD.App = function() {
if (savedFace != null) {
var geom = TCAD.workbench.readSketchGeom(JSON.parse(savedFace));
sketchFace.syncSketches(geom);
this.viewer.scene.add(sketchFace.sketch3DGroup);
}
}
this.viewer.render();

View file

@ -80,6 +80,6 @@ TCAD.Craft.prototype.current = function() {
TCAD.Craft.prototype.modify = function(solid, modification) {
var faces = modification();
this.app.viewer.scene.remove( solid.meshObject );
this.app.viewer.scene.add( TCAD.utils.createSolidMesh(faces) );
//this.app.viewer.scene.add( TCAD.utils.createSolidMesh(faces) );
this.app.viewer.render();
};