添加umd例子
This commit is contained in:
		@@ -1,3 +1,7 @@
 | 
			
		||||
1.你需要先Clone项目`http://git.cf/cx/CADViewComponent`到本地.和本项目同层.  
 | 
			
		||||
2.然后你需要对上面的项目`npm i`,`npm run build`  
 | 
			
		||||
3.然后对本项目`npm i`,`npm run dev`  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
如果您使用umd的模式开发网页,那么请参考`umdSample`目录下的例子.  
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								umdSample/cad.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								umdSample/cad.js
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										82
									
								
								umdSample/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								umdSample/index.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
  <meta charset="UTF-8">
 | 
			
		||||
  <title>cad-view</title>
 | 
			
		||||
 | 
			
		||||
  <style type="text/css">
 | 
			
		||||
    body {
 | 
			
		||||
      font-size: 11px;
 | 
			
		||||
      overflow: hidden;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    html,
 | 
			
		||||
    body {
 | 
			
		||||
      background: gray;
 | 
			
		||||
      height: 100%;
 | 
			
		||||
      padding: 0;
 | 
			
		||||
      margin: 0;
 | 
			
		||||
    }
 | 
			
		||||
  </style>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body>
 | 
			
		||||
 | 
			
		||||
  <div id="gl" style="width: 100%;height: 100%;"></div>
 | 
			
		||||
 | 
			
		||||
  <script type="text/javascript" src="three.min.js"></script>
 | 
			
		||||
  <script type="text/javascript" src="cad.js"></script>
 | 
			
		||||
 | 
			
		||||
  <script>
 | 
			
		||||
 | 
			
		||||
    let el = document.getElementById("gl");
 | 
			
		||||
    let viewer = new cad.Viewer(el);
 | 
			
		||||
 | 
			
		||||
    cad.LoadBoard(viewer, [
 | 
			
		||||
      {
 | 
			
		||||
        "L": 102,
 | 
			
		||||
        "W": 399,
 | 
			
		||||
        "H": 18,
 | 
			
		||||
        "CabName": "未命名",
 | 
			
		||||
        "BoardName": "横板1",
 | 
			
		||||
        "Grain": 0,
 | 
			
		||||
        "BasePoint": { "x": 13948.6765827702, "y": 95.4999999999999, "z": -1084.69293145331 },
 | 
			
		||||
        "XVec": { "x": 1, "y": 0, "z": 0 },
 | 
			
		||||
        "YVec": { "x": 0, "y": 2.22044604925031e-16, "z": 1 },
 | 
			
		||||
        "ZVec": { "x": 0, "y": -1, "z": 2.22044604925031e-16 },
 | 
			
		||||
        "Pts": [
 | 
			
		||||
          { "x": 399, "y": 101 },
 | 
			
		||||
          { "x": 279.17, "y": 101 },
 | 
			
		||||
          { "x": 279.17, "y": 47 },
 | 
			
		||||
          { "x": 259.17, "y": 47 },
 | 
			
		||||
          { "x": 259.17, "y": 101 },
 | 
			
		||||
          { "x": 139.83, "y": 101 },
 | 
			
		||||
          { "x": 139.83, "y": 47 },
 | 
			
		||||
          { "x": 119.83, "y": 47 },
 | 
			
		||||
          { "x": 119.83, "y": 101 },
 | 
			
		||||
          { "x": 0, "y": 101 },
 | 
			
		||||
          { "x": 0, "y": 0 },
 | 
			
		||||
          { "x": 399, "y": 0 }
 | 
			
		||||
        ],
 | 
			
		||||
        "Drillings": [
 | 
			
		||||
          {
 | 
			
		||||
            "x": 55, "y": 55, "r": 3, "h": 3, "f": 0
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "x": 85, "y": 55, "r": 3, "h": 3, "f": 0
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        "Buls": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 | 
			
		||||
        "SubBoardLocal": [],
 | 
			
		||||
        "SubBoardAssoc": []
 | 
			
		||||
      }
 | 
			
		||||
    ]);
 | 
			
		||||
 | 
			
		||||
    viewer.ZoomAll();//缩放到视图中实体刚好能看到的状态.
 | 
			
		||||
 | 
			
		||||
    viewer.Zoom(1.2);//1.2倍
 | 
			
		||||
  </script>
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										927
									
								
								umdSample/three.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										927
									
								
								umdSample/three.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user