eDrawings
Components
Sheets
Layers
Tables
Configuration
Hide/Show
Transparent/Solid
Hide Others
Show All
Remove
Clear
Model viewing failed. Please reload to try again. If the failure persists, please report the information below to customer support.
Server:
Model ID:
Drop your content here
Or

Connection timed-out. Reload the page to continue.

ir){case Communicator.ViewOrientation.Front:pos.set(0,0,1).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Back:pos.set(0,0,-1).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Left:pos.set(-1,0,0).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Right:pos.set(1,0,0).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Top:pos.set(0,1,0).scale(dist).add(center);up.set(0,0,-1);break;case Communicator.ViewOrientation.Bottom:pos.set(0,-1,0).scale(dist).add(center);up.set(0,0,1);break;case Communicator.ViewOrientation.Iso:pos.set(1,1,1).normalize().scale(dist).add(center);up.set(-.408204,.816541,-.408204);break;default:throw new Error("Unsupported orientation: "+iEyeDir)}camera.setPosition(pos);camera.setTarget(center);camera.setUp(up);viewHC.fitWorld(iDuration,camera);return camera};eDwViewMgr.prototype.setViewOrientationToDirection=function(normal){var camera=this.mViewer.getHCView().getCamera();var position=camera.getPosition();var target=camera.getTarget();var up=camera.getUp();var delta=target.subtract(position);var distance=delta.length();var bbox=this.mViewer.getModel().getBoundingBox();var bbox_min=bbox.min;var bbox_max=bbox.max;target=Communicator.Point3.add(bbox_max,bbox_min).scale(.5);var eyeVec=Communicator.Point3.scale(normal,distance);position=Communicator.Point3.add(target,eyeVec);var vTest=new Communicator.Point3(1,0,0);var isParallel=Communicator.Point3.dot(vTest,normal);if(Math.abs(Math.abs(isParallel)-1)<.001){vTest.set(0,1,0);var vec=Communicator.Point3.cross(normal,vTest);vec=vec.normalize();up=Communicator.Point3.cross(vec,normal);up=up.normalize()}else{up=Communicator.Point3.cross(normal,vTest);up=up.normalize()}var dotProd=Communicator.Point3.dot(up,new Communicator.Point3(1,0,0));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}dotProd=Communicator.Point3.dot(up,new Communicator.Point3(0,1,0));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}dotProd=Communicator.Point3.dot(up,new Communicator.Point3(0,0,1));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}camera.setPosition(position);camera.setTarget(target);camera.setUp(up);this.setCamera(camera,500);return camera};eDwViewMgr.prototype.setCamera=function(iCamera,iTimeInMS){if(iTimeInMS===void 0){iTimeInMS=400}this.mViewer.getHCView().setCamera(iCamera,iTimeInMS)};eDwViewMgr.prototype.enableAmbientOcclusion=function(iEnable){this.mViewer.getHCView().setAmbientOcclusionEnabled(iEnable);eDwEventMgr.get().fireEvents("AmbientOcclChange",this,iEnable)};eDwViewMgr.prototype.fitScreenToNodes=function(iNodeHCIDs,ioCamera){return __awaiter(this,void 0,void 0,function(){var modelHC,bbox,subtract,viewVec,center,add,ratio,boxMaxLen;return __generator(this,function(_a){switch(_a.label){case 0:if(!ioCamera)return[2];modelHC=this.mViewer.getModel().getHCModel();return[4,modelHC.getNodesBounding(iNodeHCIDs)];case 1:bbox=_a.sent();subtract=eDwTypes_26.HC.Point3.subtract;viewVec=subtract(ioCamera.getPosition(),ioCamera.getTarget());center=bbox.center().copy();ioCamera.setTarget(center);add=eDwTypes_26.HC.Point3.add;ioCamera.setPosition(add(center,viewVec));ratio=ioCamera.getWidth()/ioCamera.getHeight();if(this.mViewer.getModel().isDrawing()){bbox.min.z=bbox.max.z=0}boxMaxLen=bbox.extents().length();ioCamera.setHeight(boxMaxLen);ioCamera.setWidth(boxMaxLen*ratio);this.setCamera(ioCamera,400);return[2]}})})};eDwViewMgr.prototype.onCameraUpdate=function(){this.mViewAnimationIndex+=1;if(this.mViewAnimationIndex>=eDwViewMgr.viewAnimations.length){this.mViewAnimationIndex=0;this.mViewAnimationActive=false;this.stop()}if(this.mViewAnimationActive){this.animateNextView()}};eDwViewMgr.prototype.animateNextView=function(){var _this=this;if(this.mViewAnimationActive){this.setViewOrientation(eDwViewMgr.viewAnimations[this.mViewAnimationIndex],2e3);var self_1=this;this.mAnimationTimeOutID=window.setTimeout(function(){_this.onCameraUpdate()},2e3)}};eDwViewMgr.viewAnimations=[Communicator.ViewOrientation.Front,Communicator.ViewOrientation.Back,Communicator.ViewOrientation.Left,Communicator.ViewOrientation.Right,Communicator.ViewOrientation.Bottom,Communicator.ViewOrientation.Top,Communicator.ViewOrientation.Iso];return eDwViewMgr}();return eDwViewMgr});define("eDwXSectionMgr",["require","exports","eDwXSectionOperator","eDwGeomUtils","eDwTypes","eDwTypes","eDrawingsBase"],function(require,exports,eDwXSectionOperator,eDwGeomUtils,eDwTypes_27,eDwTypes_28){"use strict";var cSectionCapFaceColor=new eDwTypes_28.HC.Color(128,128,128);var cSectionCapOutlineColor=new eDwTypes_28.HC.Color(255,0,0);var eDwXSectionMgr=function(){function eDwXSectionMgr(iViewer){iViewer.XSectionMgr=this;this.mViewer=iViewer;var xSectionOp=new eDwXSectionOperator(iViewer);this.mXSectionOpID=iViewer.OperatorMgr.registerCustomOperator(xSectionOp);this.HCXSectionMgr=iViewer.HCViewer.getCuttingManager();this.SectionCapVisibility=false;this.mXSectionIndex=eDwTypes_27.SectionPlaneOrientation.XY.Index}eDwXSectionMgr.prototype.unregister=function(){this.mViewer.OperatorMgr.unregisterCustomOperatorByID(this.mXSectionOpID);this.mViewer.XSectionMgr=null};eDwXSectionMgr.prototype.turnOnSectionPlane=function(iOn){if(this.getHCXSection()){if(iOn){var ret=this.mViewer.OperatorMgr.push(this.mXSectionOpID);console.debugLog("Section","Section plane operator push ret = "+ret);this.HCXSectionMgr.setCappingGeometryVisibility(true)}else{var opID=this.mViewer.OperatorMgr.pop();console.debugLog("Section","Popped op ID = "+opID+" xSection op ID = "+this.mXSectionOpID)}}};eDwXSectionMgr.prototype.activateCurrent=function(){this.getHCXSection().activate()};eDwXSectionMgr.prototype.deactivateCurrent=function(){this.getHCXSection().deactivate()};eDwXSectionMgr.prototype.isCurrentActive=function(){return this.getHCXSection().isActive()};Object.defineProperty(eDwXSectionMgr.prototype,"SectionIndex",{get:function(){return this.mXSectionIndex},enumerable:true,configurable:true});eDwXSectionMgr.prototype.setSectionPlane=function(ioSection,iAllowActivation){if(iAllowActivation===void 0){iAllowActivation=true}return __awaiter(this,void 0,void 0,function(){var bbox,bboxExtents,needsActivation,sectionHC,numActive,boxCenter,sectionPlane,minPlanePt,maxPlanePt,vec,centerPt,dir,mirrorPlaneNormal,mirrorPlane,maxOnPlnPt,minOnPlnPt,mirrorPlaneDist,distDir,revDistDir,pts;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.mViewer.getModel().calculateBoundingBox()];case 1:bbox=_a.sent();bboxExtents=bbox.extents();if(!ioSection||bboxExtents.equals(eDwTypes_28.HC.Point3.zero()))return[2];needsActivation=false;sectionHC=this.getHCXSection();if(ioSection.Index!==this.mXSectionIndex){if(sectionHC){needsActivation=sectionHC.isActive();sectionHC.deactivate();this.HCXSectionMgr.refreshPlaneGeometry()}this.mXSectionIndex=ioSection.Index;sectionHC=this.getHCXSection()}numActive=this.HCXSectionMgr.getActiveCuttingSectionCount();boxCenter=bbox.center();if(sectionHC.getCount()<1){sectionPlane=ioSection.Plane.copy();sectionPlane.d=-sectionPlane.distanceToPoint(boxCenter);minPlanePt=eDwGeomUtils.dropPointOnPlane(bbox.min,sectionPlane);maxPlanePt=eDwGeomUtils.dropPointOnPlane(bbox.max,sectionPlane);vec=maxPlanePt.copy().subtract(minPlanePt);vec=vec.scale(.55);centerPt=eDwGeomUtils.dropPointOnPlane(boxCenter,sectionPlane);dir=sectionPlane.normal.copy();centerPt=centerPt.add(dir.scale(sectionPlane.d));mirrorPlaneNormal=eDwTypes_28.HC.Point3.zero();eDwTypes_28.HC.MeasureUtils.oneVectorCross(sectionPlane.normal.copy(),mirrorPlaneNormal);mirrorPlane=eDwTypes_28.HC.Plane.createFromPointAndNormal(centerPt,mirrorPlaneNormal);maxOnPlnPt=eDwTypes_28.HC.Point3.add(centerPt,vec);minOnPlnPt=eDwTypes_28.HC.Point3.add(centerPt,vec.scale(-1));mirrorPlaneDist=mirrorPlane.distanceToPoint(maxOnPlnPt);distDir=mirrorPlaneNormal.copy().scale(2*mirrorPlaneDist);revDistDir=distDir.copy().scale(-1);pts=[];pts.push(minOnPlnPt);pts.push(eDwTypes_28.HC.Point3.add(maxOnPlnPt,revDistDir));pts.push(maxOnPlnPt);pts.push(eDwTypes_28.HC.Point3.add(minOnPlnPt,distDir));sectionHC=this.getHCXSection();sectionHC.addPlane(sectionPlane,pts);sectionHC.setColor(eDwTypes_28.HC.Color.createFromFloat(0,1,0));sectionHC.setTransparency(.3);needsActivation=true}if(sectionHC&&needsActivation&&iAllowActivation){sectionHC.activate()}this.HCXSectionMgr.setStandinGeometryPickable(true);return[2]}})})};eDwXSectionMgr.prototype.flipSectionPlane=function(){var sectionHC=this.getHCXSection();if(!sectionHC)return;var sectionPlane=sectionHC.getPlane(0);if(!sectionPlane)return;sectionPlane.normal.negate();sectionPlane.d=-sectionPlane.d;sectionHC.updatePlane(0,sectionPlane)};eDwXSectionMgr.prototype.setViewToSectionPlane=function(){var sectionHC=this.getHCXSection();if(!sectionHC)return null;var sectionPlane=sectionHC.getPlane(0);if(!sectionPlane)return null;return this.mViewer.ViewMgr.setViewOrientationToDirection(sectionPlane.normal.copy())};eDwXSectionMgr.prototype.moveCurrentAlongNormal=function(iDistVec){var camera=this.mViewer.getHCView().getCamera();var camPosition=camera.getPosition();var camTarget=camera.getTarget();var camUp=camera.getUp();var camZ=camTarget.subtract(camPosition);camZ=camZ.normalize();var camY=camUp.normalize();var camX=eDwTypes_28.HC.Point3.cross(camZ,camY);var realVec=camX.scale(iDistVec.x).add(camY.scale(iDistVec.y)).add(camZ.scale(iDistVec.z));var sectionHC=this.getHCXSection();var sectionPlane=sectionHC.getPlane(0);var normal=sectionPlane.normal.copy();normal=normal.normalize();var distance=eDwTypes_28.HC.Point3.dot(realVec,normal);if(Math.abs(distance)<1e-6)return;sectionPlane.d-=distance;sectionHC.updatePlane(0,sectionPlane)};Object.defineProperty(eDwXSectionMgr.prototype,"SectionCapVisibility",{get:function(){return this.mEnableSectionCaps},set:function(iEnable){this.mEnableSectionCaps=iEnable;this.setSectionCapVisibility(iEnable)},enumerable:true,configurable:true});eDwXSectionMgr.prototype.disableSectionCapVisibility=function(iDisable){this.setSectionCapVisibility(iDisable?false:this.mEnableSectionCaps)};eDwXSectionMgr.prototype.projectPoint=function(iPnt){var sectionHC=this.getHCXSection();var sectionPlane=sectionHC.getPlane(0);return eDwGeomUtils.dropPointOnPlane(iPnt,sectionPlane)};eDwXSectionMgr.prototype.getHCXSection=function(){return this.HCXSectionMgr.getCuttingSection(this.mXSectionIndex)};eDwXSectionMgr.prototype.setSectionCapVisibility=function(iEnable){var enable=iEnable;var drawMode=this.mViewer.getDrawMode();if(drawMode!=="Shaded"&&drawMode!=="ShadedWithEdges"){enable=false}this.HCXSectionMgr.setCappingFaceColor(enable?cSectionCapFaceColor:null);this.HCXSectionMgr.setCappingLineColor(enable?null:cSectionCapOutlineColor)};return eDwXSectionMgr}();return eDwXSectionMgr});define("eDwXSectionOperator",["require","exports","eDwTypes","eDwBaseOperator","eDwCommandMgr","eDwMoveSectionPlaneCmd","eDrawingsBase"],function(require,exports,eDwTypes_29,eDwBaseOperator,eDwCommandMgr,eDwMoveSectionPlaneCmd){"use strict";var eDwXSectionOperator=function(_super){__extends(eDwXSectionOperator,_super);function eDwXSectionOperator(iViewer){return _super.call(this,iViewer)||this}eDwXSectionOperator.prototype.onActivate=function(){_super.prototype.onActivate.call(this);this.mViewer.XSectionMgr.activateCurrent()};eDwXSectionOperator.prototype.onDeactivate=function(){this.mViewer.XSectionMgr.deactivateCurrent();_super.prototype.onDeactivate.call(this)};eDwXSectionOperator.prototype.onMouseDown=function(ioMouseEvent){if(!ioMouseEvent||!this.mViewer.XSectionMgr.isCurrentActive()){ioMouseEvent.setHandled(true);return}var selObj=eDwBaseOperator.getPickResult(ioMouseEvent);var selID=selObj.getNodeId();if(!selObj||selObj.getNodeId()>=0){ioMouseEvent.setHandled(false);return}_super.prototype.onMouseDown.call(this,ioMouseEvent);var sectionMgr=this.mViewer.XSectionMgr;sectionMgr.disableSectionCapVisibility(true);if(selObj){var typeOfSel=selObj.getSelectionType();selObj=typeOfSel===eDwTypes_29.HC.SelectionType.None?null:selObj}ioMouseEvent.setHandled(true);var selNodeID=selObj.getNodeId();if(selNodeID){console.debugLog("Section","sel obj = "+JSON.stringify(selObj));var sectionMgrHC=this.mViewer.XSectionMgr.HCXSectionMgr;if(sectionMgrHC.getCuttingSectionFromNodeId(selNodeID)){this.mSectionDragPt=this.screenToWorld(ioMouseEvent.getPosition())}}if(this.mMoveSectionCmd)this.mMoveSectionCmd.cancel();this.mMoveSectionCmd=new eDwMoveSectionPlaneCmd(this.mViewer)};eDwXSectionOperator.prototype.onMouseMove=function(ioMouseEvent){ioMouseEvent.setHandled(false);var crossSectionMgr=this.mViewer.XSectionMgr;if(!crossSectionMgr.isCurrentActive()){return}if(this.mCurMouse&&this.mSectionDragPt){var coords=ioMouseEvent.getPosition();var current=this.screenToWorld(coords);var delta=eDwTypes_29.HC.Point3.subtract(current,this.mSectionDragPt);this.mViewer.XSectionMgr.moveCurrentAlongNormal(delta);this.mSectionDragPt=current;ioMouseEvent.setHandled(true)}};eDwXSectionOperator.prototype.onMouseUp=function(ioMouseEvent){_super.prototype.onMouseUp.call(this,ioMouseEvent);this.mViewer.XSectionMgr.disableSectionCapVisibility(false);ioMouseEvent.setHandled(false);this.mSectionDragPt=null;var cmdMgr=eDwCommandMgr.get();cmdMgr.add(this.mMoveSectionCmd);cmdMgr.remove(this.mMoveSectionCmd,"commit");this.mMoveSectionCmd=null};eDwXSectionOperator.prototype.onTouchStart=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Down,function(ioMouseEvent){_this.onMouseDown(ioMouseEvent)})};eDwXSectionOperator.prototype.onTouchMove=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Move,function(ioMouseEvent){_this.onMouseMove(ioMouseEvent)})};eDwXSectionOperator.prototype.onTouchEnd=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Up,function(ioMouseEvent){_this.onMouseUp(ioMouseEvent)})};eDwXSectionOperator.prototype.needsSelection=function(iEventType){return iEventType===eDwTypes_29.HC.EventType.MouseDown||iEventType===eDwTypes_29.HC.EventType.TouchStart};eDwXSectionOperator.prototype.screenToWorld=function(iScrPt){var view=this.mViewer.getHCView();var normScrPt=view.pointToWindowPosition(iScrPt);var input=new Communicator.Point3(normScrPt.x,normScrPt.y,0);var projMatrix=view.getProjectionMatrix();projMatrix.m[15]=1;var invMat=Communicator.Matrix.inverse(projMatrix).transpose();var worldPt=new Communicator.Point3(0,0,0);var div=input.x*invMat.m[3]+input.y*invMat.m[7]+input.z*invMat.m[11]+invMat.m[15];worldPt.x=(input.x*invMat.m[0]+input.y*invMat.m[1]+input.z*invMat.m[2]+invMat.m[3])/div;worldPt.y=(input.x*invMat.m[4]+input.y*invMat.m[5]+input.z*invMat.m[6]+invMat.m[7])/div;worldPt.z=(input.x*invMat.m[8]+input.y*invMat.m[9]+input.z*invMat.m[10]+invMat.m[11])/div;return worldPt};return eDwXSectionOperator}(eDwBaseOperator);return eDwXSectionOperator});define("eDwZoomToFitCmd",["require","exports","eDwSupportsHistoryCmd"],function(require,exports,eDwSupportsHistoryCmd){"use strict";var eDwZoomToFitCmd=function(_super){__extends(eDwZoomToFitCmd,_super);function eDwZoomToFitCmd(iViewer,iNodeID,iCamera){var _this=_super.call(this,iViewer)||this;_this.mInitialCamera=iCamera.copy();_this.mFinalCamera=iCamera.copy();_this.mNodeHCID=iNodeID;return _this}eDwZoomToFitCmd.prototype.undo=function(){if(!_super.prototype.undo.call(this))return false;this.mViewer.ViewMgr.setCamera(this.mInitialCamera);return true};eDwZoomToFitCmd.prototype.redo=function(){if(!_super.prototype.redo.call(this))return false;this.mViewer.ViewMgr.setCamera(this.mFinalCamera);return true};eDwZoomToFitCmd.prototype.commit=function(){_super.prototype.commit.call(this);this.mViewer.ViewMgr.fitScreenToNodes([this.mNodeHCID],this.mFinalCamera)};Object.defineProperty(eDwZoomToFitCmd.prototype,"Aggregable",{get:function(){return true},enumerable:true,configurable:true});return eDwZoomToFitCmd}(eDwSupportsHistoryCmd);return eDwZoomToFitCmd});requirejs.config({baseUrl:"./js/3rdParty",paths:{eDrawingsBase:"eDrawingsBase.min",jquery:"jquery-2.1.4.min","jquery-ui":"jquery-ui-1.11.4.min","jquery.fullscreen":"jquery.fullscreen.min","jquery.iframe-transport":"jquery.iframe-transport","jquery.fileupload":"jquery.fileupload","solidworks.web":"solidworks.web"},map:{"jquery.fileupload":{"jquery-ui/ui/widget":"jquery-ui"}},shim:{eDrawingsBase:{deps:["jquery"]},"jquery-ui":{deps:["jquery"]},"jquery.fullscreen":{deps:["jquery"]}}});requirejs(["eDrawingsWebViewer"],function(eDwWebViewer){console.excludeDebugLogCategories=["UIEvents","BaseSelOp","Operator"];eDwWebViewer.start()});define("utils",["require","exports"],function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function forAll(iFunc,iDictionary){if(!iDictionary)return;Object.keys(iDictionary).forEach(function(iKeyString){var key=parseInt(iKeyString,10);iFunc(key,iDictionary[key])})}exports.forAll=forAll;function getUint8Array(iBase64EncodedString){var binString=window.atob(iBase64EncodedString);var len=binString.length;var bytes=new Uint8Array(len);for(var i=0;i