aggiunti parametri approx e isOrto

This commit is contained in:
zaccaria.majid
2023-10-25 16:27:05 +02:00
parent d17149f05e
commit 99f2ebf7d4
5 changed files with 11 additions and 18 deletions
+3 -3
View File
@@ -21,12 +21,12 @@
let options ={
_dimX : X,
_dimY: Y,
_fileName: "ProjectSlice.3mf",
_fileName: "ProjectSlice.3dm",
_showGrid: true,
_showInfiniteGrid: false,
_isOrtographic: true,
_isOrtographic: false,
_modelsDir: "./src/test3/",
_fileType: '3MF',
_fileType: '3DM',
_showFrame: true,
_frameType: 2,
_frameLen: 150, //mm
+1 -1
View File
@@ -9298,7 +9298,7 @@
"node_modules/webgl-visualizer": {
"version": "1.2.23102410",
"resolved": "https://nexus.steamware.net/repository/npm-group/webgl-visualizer/-/webgl-visualizer-1.2.23102410.tgz",
"integrity": "sha512-HDX9WyHsaRxBAxDB3B3I/soBBkVQF0+AaKaPYWXi9iMRMqA6JI3SWQ4+yv1rFM9ow3gLI7VNbUydHQ/WIvaKrw==",
"integrity": "sha512-TAM6j63UVjTVMkOjBR1je0TGEEVJCeDOzze2macpHHjRgf4A1ngcWmElH5UYn0TQz9+8otmvTYUcTHKDN5501A==",
"license": "ISC"
},
"node_modules/webpack": {
+3 -1
View File
@@ -15,7 +15,9 @@
<input type='button' id='bt_camera' value = "Toggle Camera">
<input type='checkbox' id='ck_print' checked>
</div>
<div id = "WebGL-Export">
<div id="test-id">
<div id = "WebGL-Export">
</div>
</div>
</div>
</template>
+4 -13
View File
@@ -14,7 +14,7 @@ var fName = "";
var fileType = '3DM';
var m_nApproxIndex = 5;
var m_nApproxIndex = 0;
var m_bShowDir = true;
@@ -56,11 +56,12 @@ var layer_list = [];
const GLBox3D = new THREE.Box3(); // Box3D globale delle geometrie
//init();
class webgl_original {
async initcall({ _dimX, _dimY, _fileName, _showInfiniteGrid, _fileType, _modelsDir, _showGrid, _showFrame, _frameType, _frameLen, _frameFat}) {
async initcall({ _dimX, _dimY, _fileName, _isOrtographic , _showInfiniteGrid, _fileType, _modelsDir, _showGrid, _showFrame, _frameType, _frameLen, _frameFat, _approxIndex}) {
m_divStartDimX = _dimX;
m_divStartDimY = _dimY;
m_bShowGrid = _showGrid;
fName = _fileName;
m_bIsOrtographic = _isOrtographic;
m_bInfGrid = _showInfiniteGrid;
modelsDir = _modelsDir;
fileType = _fileType;
@@ -68,6 +69,7 @@ class webgl_original {
m_bFrameType = _frameType;
m_lFrameLen = _frameLen;
m_dFrameFat = _frameFat;
m_nApproxIndex = _approxIndex;
//console.log(fName)
setLoaders();
if(fileType.toUpperCase() == '3MF')
@@ -114,7 +116,6 @@ function setLoaders() {
}
const spinContainer = document.createElement('div');
const sliderInput = document.createElement('input');
const elParent = document.createElement('div');
const elChild1 = document.createElement('div');
const elChild2 = document.createElement('div');
@@ -124,14 +125,6 @@ function setLoaders() {
const elChild6 = document.createElement('div');
const loadTxt = document.createElement('div');
//if (useInSlider) {
mother.appendChild(sliderInput);
sliderInput.setAttribute('id', 'refre_slider');
sliderInput.setAttribute('hidden', true);
sliderInput.type = 'range';
sliderInput.min = '0';
//}
mother.appendChild(spinContainer);
//document.body.appendChild(spinContainer);
spinContainer.appendChild(elParent);
@@ -551,7 +544,6 @@ function AdaptSeceneToContest() {
var container = document.getElementById( 'WebGL-Export') ;
container.style.height = m_divStartDimY + "px";
container.style.width = m_divStartDimX + "px";
document.body.appendChild( container );
renderer.setSize( m_divStartDimX, m_divStartDimY) ;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap ;
@@ -781,7 +773,6 @@ function AddGrid( ptORIG) {
gridHelper.position.set( ptORIG.position.x, ptORIG.position.y, ptORIG.position.z) ;
gridHelper.material.transparent = true ;
gridHelper.material.opacity = 0.25 ;
setFog() ;
scene.add( gridHelper) ;
}
else {