60 Commits

Author SHA1 Message Date
Samuele Locatelli 6eec667964 Merge tag 'AddNpmWebDoorViewer_02' into develop
Update src + update readme x uso componente
2024-06-26 16:55:30 +02:00
Samuele Locatelli 3497c70fb9 Merge branch 'release/AddNpmWebDoorViewer_02' 2024-06-26 16:54:26 +02:00
Samuele Locatelli 94d93223ea Fix CI/CD x main deploy package
- update readme c#
update src x compilazione
2024-06-26 16:54:00 +02:00
Samuele Locatelli 218625fba4 Merge tag 'AddNpmWebDoorViewer_01' into develop
Aggiunta primo rilascio webdoor viewer
2024-06-26 16:23:50 +02:00
Samuele Locatelli a9de0e61df Merge branch 'release/AddNpmWebDoorViewer_01' 2024-06-26 16:05:35 +02:00
Samuele Locatelli 2886402d55 typo commenti 2024-06-26 16:05:16 +02:00
Samuele Locatelli 07fcc47685 Update area TJSD + yaml x robocopy 2024-06-26 15:51:08 +02:00
Samuele Locatelli 27881a1acc update yaml CI/CD 2024-06-26 15:46:26 +02:00
Samuele Locatelli e4502353af Refresh index x compilare npm 2024-06-26 15:42:22 +02:00
Samuele Locatelli ebdb36180e Completato review classi in test!!! ok tablet 2024-06-26 15:21:48 +02:00
Samuele Locatelli 9b902473c2 Update grafico pagina visualizzatore 2024-06-26 10:55:51 +02:00
Samuele Locatelli 3a0161a3dd Update pagina base x nuovi buttons 2024-06-25 18:37:45 +02:00
Samuele Locatelli c054880749 Update comportamento rotazioni e start/stop animazione 2024-06-25 17:32:57 +02:00
Samuele Locatelli 845e309769 Update gestione controlli 2024-06-25 17:10:00 +02:00
Samuele Locatelli 3ba52f1aee fix click sul cubo 2024-06-25 12:33:29 +02:00
Samuele Locatelli 8de856ba4c update gestione start/stop animazione 2024-06-25 12:32:00 +02:00
Samuele Locatelli 4860c824af Fix comportamento animazione start/stop x risparmio GPU 2024-06-25 12:10:27 +02:00
Samuele Locatelli 67ac56922f Fix commenti e continuo reorg codice 2024-06-25 11:08:50 +02:00
Samuele Locatelli 1c949d0329 Spostata gestione eventi in pagina 2024-06-25 10:55:57 +02:00
Samuele Locatelli ae30af04ca yaml da testare... 2024-06-22 12:48:37 +02:00
Samuele Locatelli 1a73e06fc4 Update yaml x CI/CD (proviamo nuovo pacchetto...) 2024-06-22 12:15:18 +02:00
Samuele Locatelli 1581e03d3e Update area src x npm 2024-06-22 12:15:02 +02:00
Samuele Locatelli b26ba3824f review test area con 2 varianti index2 e index3 2024-06-22 10:48:51 +02:00
Samuele Locatelli 6fa3363acc update parziale draw.js 2024-06-21 17:12:04 +02:00
Samuele Locatelli bac6276c3d Fix test js only ridotto ai minimi termini, inizio gestione bootstrapper 2024-06-21 16:47:04 +02:00
Samuele Locatelli 4dcc7a0117 Aggiunta progetto test solo x 3mf e doors in c# 2024-06-21 16:29:31 +02:00
Samuele Locatelli b9819261b0 pulizia progetto test vecchio 3mf slicer 2024-06-21 15:31:42 +02:00
Samuele Locatelli cb0bf3aa38 Pulizia area webDoorView x creare npm 2024-06-21 15:03:09 +02:00
Samuele Locatelli 5ae9229f60 Riorganizzato area test IIS con minimo indispensabile 2024-06-21 15:02:49 +02:00
Samuele Locatelli df397c7a06 refresh (non va ) 2024-06-20 19:59:55 +02:00
Samuele Locatelli 5f3497259d Ancora spostamenti libs (da rivedere...) 2024-06-20 19:59:50 +02:00
Samuele Locatelli db13a4b89a reorg file 2024-06-20 19:46:20 +02:00
Samuele Locatelli 38b4cb70c3 Aggiunta demo page x door 2024-06-20 19:46:12 +02:00
Samuele Locatelli c2fa7debf5 Add js x test plot door 2024-06-20 19:31:59 +02:00
Samuele Locatelli 68c781f047 Modifica nome pagine 2024-06-20 19:31:46 +02:00
Samuele Locatelli bce4a9ac7f Aggiunta preliminare libreria webgl (da ripulire?!?) 2024-06-20 19:31:35 +02:00
Samuele Locatelli ad95f94e1f Fix progetto CSharp x demo 3d slicer 2024-06-20 19:11:36 +02:00
Samuele Locatelli 9d21649e42 Aggiunta npmrc da usare x auth 2024-06-11 15:38:58 +02:00
Samuele Locatelli 4678ca1424 Fix pagina index 2024-06-11 11:46:00 +02:00
Riccardo Elitropi 0edea24c43 Primo codice di prova ( testare funzionalità ). 2024-03-27 13:08:46 +01:00
Riccardo Elitropi 8d1cbef568 primo commit ( versione di prova ). 2024-03-26 13:20:40 +01:00
Samuele Locatelli f749cb75b9 rimessa cartella build di threejs 2024-03-26 08:35:48 +01:00
Samuele Locatelli baf418e11b Fix deploy IIS01 + recupero versione IIS01 attuale 2024-03-26 08:11:56 +01:00
Samuele Locatelli 450994be2e correzione path X 2024-03-26 08:06:55 +01:00
Samuele Locatelli 462cea065c Correzione dest path 2024-03-25 20:17:13 +01:00
Samuele Locatelli bc341f4f81 aggiunto output cmd net use 2024-03-25 20:13:05 +01:00
Samuele Locatelli fee5c27494 Modifica gitlab x copia rsync verso IIS01... 2024-03-25 20:08:55 +01:00
Samuele Locatelli 5e971e6cfd Readme x area webdoor (da completare) 2024-03-25 09:00:36 +01:00
Samuele Locatelli 93c5a8a37a Aggiunto area test IIS01 2024-03-25 08:55:25 +01:00
Samuele Locatelli 438399d7a1 Riorganizzazione REPO x multi viewers 2024-03-25 08:51:52 +01:00
Samuele Locatelli 2fcd7490ec Merge remote-tracking branch 'origin/main' into develop 2024-03-25 08:17:11 +01:00
zaccaria.majid 60cdd29467 fix ancora pacchetto rhino 2023-10-27 16:54:55 +02:00
zaccaria.majid 88de130f3f fix call inutile a rhino 2023-10-27 16:50:43 +02:00
zaccaria.majid f4de5a3334 Merge branch 'develop' 2023-10-27 16:36:47 +02:00
zaccaria.majid 99f2ebf7d4 aggiunti parametri approx e isOrto 2023-10-25 16:27:05 +02:00
zaccaria.majid d17149f05e fix call con nome sbagliato 2023-10-24 10:40:34 +02:00
zaccaria.majid ec48782dc8 Merge branch 'develop' 2023-10-24 10:34:09 +02:00
zaccaria.majid ec5892849a Merge branch 'develop' 2023-10-05 09:53:21 +02:00
zaccaria.majid 8fe2f1571e Merge branch 'develop' 2023-10-04 08:44:20 +02:00
zaccaria.majid f300e37ef3 commentati momentaneamente loaders 2023-10-03 16:11:25 +02:00
1751 changed files with 626237 additions and 138 deletions
+3 -17
View File
@@ -2,32 +2,17 @@
#############################################
# Area generale
#############################################
StockMan.suo
*.suo
*.bak
*.cache
*.pdb
.DS_Store
#ignoro i pdb: area comune packages
/packages/AjaxControlToolkit.4.1.60623/lib/40/*.pdb
/packages/AjaxControlToolkit.4.1.60623/lib/35/*.pdb
/packages/*.pdb
/packages/*/*.pdb
/packages/*/*/*.pdb
/packages/*
#############################################
# Area SHERPA
#############################################
# ignoro i files log/PDF/temp
SHERPA/logs/*.txt
SHERPA/logs/*.zip
|SHERPA/logs/.PlaceHolder.file
SHERPA/bin/*
SHERPA/obj/*
VersGen/bin/*
VersGen/obj/*
@@ -0,0 +1,333 @@
# ---> VisualStudio
@@ -50,7 +35,8 @@ VersGen/obj/*
[Rr]eleases/
x64/
x86/
build/
#2024.03.26 rimessa area build x costruzione base path di threejs
#build/
bld/
[Bb]in/
[Oo]bj/
@@ -97,7 +83,7 @@ artifacts/
*.log
*.vspscc
*.vssscc
.builds
#.builds
*.pidb
*.svclog
*.scc
+82 -15
View File
@@ -8,8 +8,13 @@ variables:
NEW_COPYRIGHT: 'EgalWare 2022+'
JSON_FILE: ''
JSON_FILE_RAW: ''
NET_SHARE_X: '\\iis01\Test3D'
NET_USERQ: 'steamw\egalware'
SRC_PATH: 'TestArea_IIS01\'
# valutare se elenco --> ciclo https://docs.gitlab.com/ee/ci/variables/#store-multiple-values-in-one-variable
DIR_PATH: 'TJSD THREEJS_DOORS'
# helper (anchors, vedere https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html) x fix vers number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM) + (get-date -format ddHH)
@@ -22,6 +27,21 @@ variables:
Write-Output $resoconto;
echo "VersionFix done"
# helper copia area test 3D verso cartella di rete X:\ (IIS01) delle cartelle della TestArea_IIS01
.ReplicaX: &ReplicaX
- |
net use X: /delete
SLEEP 2
#$mountCmd = "net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $SDRIVE_PASSWD"
#Write-Output $mountCmd;
net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $SDRIVE_PASSWD
Foreach ($sDir in ($env:DIR_PATH -split " ")) {
#Write-Output "ROBOCOPY /MIR $env:SRC_PATH\$sDir\ X:\$sDir\"
ROBOCOPY /MIR $env:SRC_PATH\$sDir\ X:\$sDir\
}
SLEEP 2
net use X: /delete
image:
node:latest
@@ -30,17 +50,19 @@ stages:
- release
# ---------- Upload Debug/Unstable ----------
WebGl3D:deploy:
before_script:
- *version-fix
tags:
- win
WebGl.Icarus:deploy:
stage: build
variables:
APP_NAME: WebGl-Visualizer
only:
- develop
stage: build
tags:
- win
before_script:
- *version-fix
- *ReplicaX
script:
- cd .\WebGl\
- cd .\IcarusView\WebGl\
- Set-Content -Path "./.npmrc" -Value "email=ceo@steamware.net `nalways-auth=true `n//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- $JSON_FILE = Get-Content '.\package.json' -raw
- $JSON_FILE_RAW = $JSON_FILE | ConvertFrom-Json
@@ -49,17 +71,62 @@ WebGl3D:deploy:
- echo "//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- npm publish
# ---------- RELEASE ----------
WebGl3D:release:
before_script:
- *version-fix
WebGl.Door:deploy:
stage: build
variables:
APP_NAME: WebGl-Door-Visualizer
only:
- develop
tags:
- win
before_script:
- *version-fix
- *ReplicaX
script:
- cd .\WebDoorView\src\
- Set-Content -Path "./.npmrc" -Value "email=ceo@steamware.net `nalways-auth=true `n//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- $JSON_FILE = Get-Content '.\package.json' -raw
- $JSON_FILE_RAW = $JSON_FILE | ConvertFrom-Json
- $JSON_FILE_RAW.version="$env:NUM_DEB"
- $JSON_FILE_RAW | ConvertTo-Json -depth 32| set-content '.\package.json'
- echo "//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- npm publish
# ---------- RELEASE ----------
WebGl3D.Icarus:release:
stage: release
variables:
APP_NAME: WebGl-Visualizer
only:
- main
stage: release
tags:
- win
before_script:
- *version-fix
- *ReplicaX
script:
- cd .\WebGl\
- cd .\IcarusView\WebGl\
- Set-Content -Path "./.npmrc" -Value "email=ceo@steamware.net `nalways-auth=true `n//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- $JSON_FILE = Get-Content '.\package.json' -raw
- $JSON_FILE_RAW = $JSON_FILE | ConvertFrom-Json
- $JSON_FILE_RAW.version="$env:NEW_REL"
- $JSON_FILE_RAW | ConvertTo-Json -depth 32| set-content '.\package.json'
- echo "//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- npm publish
WebGl3D.Door:release:
stage: release
variables:
APP_NAME: WebGl-Door-Visualizer
only:
- main
tags:
- win
before_script:
- *version-fix
- *ReplicaX
script:
- cd .\WebDoorView\src\
- Set-Content -Path "./.npmrc" -Value "email=ceo@steamware.net `nalways-auth=true `n//nexus.steamware.net/repository/npm-hosted/:_authToken=$NPM_TOKEN"
- $JSON_FILE = Get-Content '.\package.json' -raw
- $JSON_FILE_RAW = $JSON_FILE | ConvertFrom-Json
-3
View File
@@ -1,3 +0,0 @@
email=ceo@steamware.net
always-auth=true
//nexus.steamware.net/repository/npm-hosted/:_authToken=NpmToken.9adde2db-ccdc-3a28-bd41-ff4f3d711993
-48
View File
@@ -1,48 +0,0 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.StaticFiles;
using Web3D.pack.Data;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
var provider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider();
// NOTE: Add new mappings
provider.Mappings[".3mf"] = "model"; // NOTE: add the extension (with period) and its type
// NOTE: comment this line of code out
// app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions // NOTE: replace the line app.UseStaticFiles(); with this block of code
{
ContentTypeProvider = provider
});
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
-17
View File
@@ -1,17 +0,0 @@
{
"version": "1.0",
"defaultProvider": "filesystem",
"libraries": [
{
"library": "C:\\Users\\zaccaria.majid\\Downloads\\package",
"destination": "wwwroot/lib/package/"
},
{
"library": "C:\\Users\\zaccaria.majid\\Downloads\\",
"destination": "wwwroot/lib/Downloads/",
"files": [
"webgl-visualizer-1.1.230926-beta.842.tgz"
]
}
]
}
+4
View File
@@ -0,0 +1,4 @@
email=ceo@steamware.net
always-auth=true
//nexus.steamware.net/repository/npm-hosted/:_authToken=NpmToken.9adde2db-ccdc-3a28-bd41-ff4f3d711993
//nexus.steamware.net/repository/npm-group/:_authToken=NpmToken.63c81032-4adf-327f-b9b0-9ab32f867706
@@ -21,11 +21,12 @@
let options ={
_dimX : X,
_dimY: Y,
_fileName: "Ex3.3dm",
_fileName: "ProjectSlice.3dm",
_showGrid: true,
_showInfiniteGrid: false,
_isOrtographic: true,
_sourceDir: "./src/source/",
_modelsDir: "./src/source/models/",
_fileType: '3DM',
_showFrame: true,
_frameType: 2,
@@ -34,7 +35,7 @@
_approxIndex: 5,
}
console.log(options._souceDir + options._fileName)
console.log(options._sourceDir + options._fileName)
WGL.initcall(options);
document.getElementById("refre_slider").oninput = function() {
@@ -10,7 +10,7 @@
"license": "MIT",
"dependencies": {
"vue": "^2.5.11",
"webgl-visualizer": "^1.2.231023-beta.1106"
"webgl-visualizer": "^1.2.23102410"
},
"devDependencies": {
"babel-core": "^6.26.0",
@@ -9296,9 +9296,9 @@
}
},
"node_modules/webgl-visualizer": {
"version": "1.2.231023-beta.1106",
"resolved": "https://nexus.steamware.net/repository/npm-group/webgl-visualizer/-/webgl-visualizer-1.2.231023-beta.1106.tgz",
"integrity": "sha512-sEA/GbeshPuIKnDDDfZGdS91QhnJsy8Vi/k/az57J2Wv9Ahx7DMhjF5S7EhI33JxQ0ZXJQYCSaoBe3eTOwgZ3A==",
"version": "1.2.23102410",
"resolved": "https://nexus.steamware.net/repository/npm-group/webgl-visualizer/-/webgl-visualizer-1.2.23102410.tgz",
"integrity": "sha512-TAM6j63UVjTVMkOjBR1je0TGEEVJCeDOzze2macpHHjRgf4A1ngcWmElH5UYn0TQz9+8otmvTYUcTHKDN5501A==",
"license": "ISC"
},
"node_modules/webpack": {
@@ -11,7 +11,7 @@
},
"dependencies": {
"vue": "^2.5.11",
"webgl-visualizer": "^1.2.231023-beta.1106"
"webgl-visualizer": "^1.2.23102410"
},
"browserslist": [
"> 1%",
@@ -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>

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

+6
View File
@@ -0,0 +1,6 @@
{
"name": "Web3D-Vue",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}
@@ -1,4 +1,4 @@
@page "/W3D"
@page "/w3d-slicer"
@using System.Runtime.InteropServices
@@ -6,7 +6,7 @@ using System.Reflection.Metadata.Ecma335;
namespace Web3D.pack.Pages
{
public partial class W3D : IDisposable
public partial class W3dSlicer : IDisposable
{
#region Protected Properties
@@ -46,6 +46,7 @@
<script type="module" src="~/lib/node_modules/webgl-visualizer/draw/webgl_drawCS.js"></script>
<script type="module" src="~/lib/webgl_help.js"></script>
<script type="module" src="~/lib/webgl_door_help.js"></script>
<script src="_framework/blazor.server.js"></script>
</body>
+87
View File
@@ -0,0 +1,87 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.FileProviders;
using Web3D.pack.Data;
var builder = WebApplication.CreateBuilder(args);
// configuration setup
Microsoft.Extensions.Configuration.ConfigurationManager configuration = builder.Configuration;
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
var provider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider();
// NOTE: Add new mappings
provider.Mappings[".3mf"] = "model"; // NOTE: add the extension (with period) and its type
provider.Mappings[".3dm"] = "model"; // NOTE: add the extension (with period) and its type
// NOTE: comment this line of code out
// app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions // NOTE: replace the line app.UseStaticFiles(); with this block of code
{
ContentTypeProvider = provider
});
// gestione static files x modelli 3D: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.0
string path3mf = configuration.GetValue<string>("ServerConf:path3mf") ?? configuration.GetValue<string>("OptConf:path3mf") ?? "";
if (!string.IsNullOrEmpty(path3mf))
{
// verifico esista folder disegni
if (Directory.Exists(path3mf))
{
// gestione cartella x PDF
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(path3mf),
RequestPath = "/3mf",
ContentTypeProvider = provider
});
}
}
string path3dm = configuration.GetValue<string>("ServerConf:path3dm") ?? configuration.GetValue<string>("OptConf:path3dm") ?? "";
if (!string.IsNullOrEmpty(path3dm))
{
// verifico esista folder disegni
if (Directory.Exists(path3dm))
{
// gestione cartella x PDF
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(path3dm),
RequestPath = "/3dm",
ContentTypeProvider = provider
});
}
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
@@ -15,8 +15,8 @@
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="W3D">
<span class="oi oi-list-rich" aria-hidden="true"></span> Test 3MF
<NavLink class="nav-link" href="w3d-slicer">
<span class="oi oi-badge" aria-hidden="true"></span> Test Slice 3mf
</NavLink>
</div>
</nav>
@@ -7,18 +7,22 @@
</PropertyGroup>
<ItemGroup>
<Content Include="wwwroot\lib\node_modules\.package-lock.json" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\package.json" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\bottom.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\left.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\LogoClassic_NoText.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\right.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\SuperTopLogo.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\top.png" />
<Compile Remove="Temp\**" />
<Content Remove="Temp\**" />
<EmbeddedResource Remove="Temp\**" />
<None Remove="Temp\**" />
</ItemGroup>
<ItemGroup>
<Folder Include="Temp\" />
<Content Include="wwwroot\lib\node_modules\.package-lock.json" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\models\.placeholder" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\models\3mf\Cubo.3mf" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\package.json" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\bottom.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\left.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\right.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\SuperTopLogo.png" />
<Content Include="wwwroot\lib\node_modules\webgl-visualizer\styles\top.png" />
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,13 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ServerConf": {
"path3mf": "\\\\iis01\\Test3D\\3mf",
"path3dm": "\\\\iis01\\Test3D\\3dm"
}
}

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

@@ -0,0 +1,485 @@
import * as THREE from '../threeJsLib/three.module.js';
import { OrbitControls } from '../jsm/controls/OrbitControls.js';
import { ThreeMFLoader } from '../jsm/loaders/3MFLoader.js';
// VARIABILI DI CONTROLLO
var m_divStartDimX = 500;
var m_divStartDimY = 400;
var fName = "Cubo.3mf";
var m_fileSource = '';
var m_bZoom = true;
var m_bPan = true;
var m_bRot = true;
var m_bAutoRot = false;
var m_bGrid_v1 = true ;
var m_nCameraStartPos = 8 ;
//var useInSlider = false;
var m_nCamPos = 0;
var m_nStartL = 0;
var m_nEndL = 0;
var m_bIsOrtographic = true ;
var counter = 0;
let activeCamera, scene, renderer, controls, ORIG, perspectiveCamera, orthographicCamera;
var layer_list = [];
const GLBox3D = new THREE.Box3(); // Box3D globale delle geometrie
//init();
class webgl_original {
async initcall({ _dimX, _dimY, _fileName, _showInfiniteGrid}) {
m_divStartDimX = _dimX;
m_divStartDimY = _dimY;
fName = _fileName;
m_bGrid_v1 = _showInfiniteGrid;
//console.log(fName)
setLoaders();
await init();
}
setCameraType(){
toggleCamera( perspectiveCamera, orthographicCamera);
}
refreshcall(nStart, nEnd) {
refreshElement(nStart, nEnd);
}
resetCamera() {
SetCameraPos( m_nCameraStartPos, ORIG) ;
}
}
export { webgl_original }
function toggleCamera( perspectiveCamera, orthographicCamera) { // <-----------------
var cameraPosition = activeCamera.position.clone() ;
var cameraMatrix = activeCamera.matrix.clone() ;
var ControlsTarget = controls.target.clone() ;
var ControlsPosition = controls.position0.clone() ;
if ( m_bIsOrtographic == true) {
m_bIsOrtographic = false ;
activeCamera = perspectiveCamera ;
activeCamera.position.copy( cameraPosition) ;
activeCamera.matrix.copy( cameraMatrix) ;
} else {
m_bIsOrtographic = true ;
activeCamera = orthographicCamera ;
activeCamera.position.copy( cameraPosition) ;
activeCamera.matrix.copy( cameraMatrix) ;
}
activeCamera.updateProjectionMatrix() ;
controls.object = activeCamera ;
controls.target = ControlsTarget ;
controls.position0 = ControlsPosition ;
controls.update() ;
render() ;
}
function setLoaders() {
//<input type="range" class="form-range" id="customRange1">
const mother = document.getElementById('WebGL-3mfExport');
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');
const elChild3 = document.createElement('div');
const elChild4 = document.createElement('div');
const elChild5 = document.createElement('div');
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);
spinContainer.appendChild(loadTxt);
elParent.appendChild(elChild1);
elParent.appendChild(elChild2);
elParent.appendChild(elChild3);
elParent.appendChild(elChild4);
elParent.appendChild(elChild5);
elParent.appendChild(elChild6);
loadTxt.setAttribute('id', 'loadTxt');
spinContainer.setAttribute('id', 'spinContainer');
var st = 'height: ' + m_divStartDimY + 'px ; width: ' + m_divStartDimX + 'px ; background-color: #a0a0a0';
spinContainer.setAttribute("style", st);
elParent.setAttribute('id', 'sp');
elParent.classList.add('spinner');
loadTxt.style.padding = '30px 0 0 0'
loadTxt.innerText = 'Loading...';
loadTxt.style.fontSize = '50px';
loadTxt.style.fontFamily = 'Helvetica';
spinContainer.style.display = 'flex';
spinContainer.style.alignItems = 'center';
spinContainer.style.justifyContent = 'center';
spinContainer.style.flexDirection = 'column';
elParent.style.width = '70.4px';
elParent.style.height = '70.4px';
elParent.style.setProperty('--clr', 'rgb(247, 197, 159)');
elParent.style.setProperty('--clr-alpha', 'rgb(247, 197, 159,.1)');
elParent.style.transformStyle = 'preserve-3d';
elParent.animate([
// key frames
{ transform: 'rotate(45deg) rotateX(-25deg) rotateY(25deg)' },
{ transform: 'rotate(45deg) rotateX(-385deg) rotateY(25deg)' },
{ transform: 'rotate(45deg) rotateX(-385deg) rotateY(385deg)' }
], {
// sync options
duration: 2600,
iterations: Infinity,
easing: 'ease',
rangeStart: "cover 0%",
rangeEnd: "cover 100%"
});
var cDiv = elParent.children;
for (var i = 0; i < cDiv.length; i++) {
if (cDiv[i].tagName == "DIV") { //or use toUpperCase()
cDiv[i].style.height = '100%';
cDiv[i].style.position = 'absolute';
cDiv[i].style.width = '100%';
cDiv[i].style.border = '#afc5d6';
cDiv[i].style.backgroundSize = 'contain';
cDiv[i].style.backgroundImage = 'url(./styles/LogoClassic_NoText.png)'
}
}
elChild1.style.transform = 'translateZ(-35.2px) rotateY(180deg)';
elChild2.style.transform = 'rotateY(-270deg) translateX(50%)';
elChild2.style.transformOrigin = 'top right';
elChild3.style.transform = 'rotateY(270deg) translateX(-50%)';
elChild3.style.transformOrigin = 'center left';
elChild4.style.transform = 'rotateX(90deg) translateY(-50%)';
elChild4.style.transformOrigin = 'top center';
elChild5.style.transform = 'rotateX(-90deg) translateY(50%)';
elChild5.style.transformOrigin = 'bottom center';
elChild6.style.transform = 'translateZ(35.2px)';
}
function init() {
const manager = new THREE.LoadingManager();
const loader = new ThreeMFLoader(manager);
let startTime = performance.now();
return new Promise(() => {
setTimeout(() => {
loader.load('./models/3mf/' + fName, function (object) {
object.rotation.set(-Math.PI / 2, 0, 0);
object.traverse(function (child) {
child.castShadow = true;
});
for (var i = 0; i < object.children.length; ++i) {
var child = object.children[i];
child.rotation.set(-Math.PI / 2, 0, 0);
layer_list.push(child);
}
//console.log(layer_list);
AdaptSeceneToContest();
// Adapting Scene to contest
let endTime = performance.now();
let timeElapsed = endTime - startTime;
console.log('init in : ' + timeElapsed)
});
}, 0);
});
}
function AdaptSeceneToContest() {
scene = new THREE.Scene();
scene.background = new THREE.Color(0xa0a0a0);
//if (useInSlider) {
document.getElementById("refre_slider").max = layer_list[layer_list.length - 1].children[0].nLayer;
document.getElementById("refre_slider").value = layer_list[layer_list.length - 1].children[0].nLayer;
document.getElementById("refre_slider").removeAttribute('hidden');
//}
for (var i = 0; i < layer_list.length; ++i) {
const Objbox = new THREE.Box3().setFromObject(layer_list[i]);
GLBox3D.union(Objbox);
layer_list[i].children[0].material.side = THREE.DoubleSide;
if (typeof layer_list[i].children[0].nLayer !== "undefined") {
scene.add(layer_list[i]);
}
}
const BoxHelper = new THREE.Box3Helper(GLBox3D, 0xffff00);
// setting camera position
const vtCenter = new THREE.Vector3(0, 0, 0);
GLBox3D.getCenter(vtCenter);
const vtPosition = vtCenter.clone().multiplyScalar(5);
const vtBoxDim = new THREE.Vector3(0, 0, 0);
GLBox3D.getSize(vtBoxDim);
// camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 1, 30000);
// camera.position.set(2 * vtBoxDim.x, 2 * vtBoxDim.y, 2 * vtBoxDim.z);
// camera.lookAt(vtCenter.x, vtCenter.y, vtCenter.z);
// scene.add(camera);
perspectiveCamera = new THREE.PerspectiveCamera( 35, window.innerWidth / window.innerHeight, 1, 300000 );
//perspectiveCamera.up = new THREE.Vector3( 0, 0, 1) ;
orthographicCamera = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2,
window.innerHeight / 2, window.innerHeight / - 2,
-300000, 300000) ;
//orthographicCamera.up = new THREE.Vector3( 0, 0, 1) ;
if ( ! m_bIsOrtographic)
activeCamera = perspectiveCamera ;
else
activeCamera = orthographicCamera ;
activeCamera.position.set( 2 * vtBoxDim.x, 2 * vtBoxDim.y, 2 * vtBoxDim.z) ;
activeCamera.lookAt( vtCenter.x, vtCenter.y, vtCenter.z) ;
scene.add( activeCamera) ;
const hemiLight = new THREE.HemisphereLight(0xffffff, 0x8d8d8d);
hemiLight.position.set(vtCenter.x, vtCenter.y + 2 * vtBoxDim.y, vtCenter.z);
scene.add(hemiLight);
var HemisphereLightHelper = new THREE.Mesh(new THREE.SphereGeometry(15, 30, 15),
new THREE.MeshStandardMaterial({ color: 0xffffff, emissive: 0x404040 }));
HemisphereLightHelper.position.set(vtCenter.x, vtCenter.y + 2 * vtBoxDim.y, vtCenter.z);
const dirLight = new THREE.DirectionalLight(0xffffff);
dirLight.position.set(vtPosition.x, vtPosition.y, vtPosition.z);
dirLight.castShadow = true;
dirLight.shadow.camera.top = 50;
dirLight.shadow.camera.bottom = - 25;
dirLight.shadow.camera.left = - 25;
dirLight.shadow.camera.right = 25;
dirLight.shadow.camera.near = 0.1;
dirLight.shadow.camera.far = 200;
dirLight.shadow.mapSize.set(1024, 1024);
scene.add(dirLight);
const DirLighthelper = new THREE.DirectionalLightHelper(dirLight, 100);
const ground = new THREE.Mesh(new THREE.PlaneGeometry(10000, 10000),
new THREE.MeshPhongMaterial({ color: 0x36454F, depthWrite: true, }));
ground.rotation.x = - Math.PI / 2;
ground.position.y = -0.5;
ground.receiveShadow = true;
ground.material.opacity = 0.25;
ground.material.transparent = true;
ground.material.side = THREE.DoubleSide;
//scene.add( ground);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
var container = document.getElementById('WebGL-3mfExport');
container.style.height = '100%';
container.style.width = '100%';
renderer.setSize(m_divStartDimX, m_divStartDimY);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
container.appendChild(renderer.domElement);
var cont = document.getElementById('spinContainer');
container.removeChild(cont);
controls = new OrbitControls(activeCamera, renderer.domElement);
controls.addEventListener('change', render);
controls.update();
window.addEventListener('resize', onWindowResize);
// calcolo origine
const points_array = [ new THREE.Vector3( 0, 0, 0)] ;
var ORIG_Geometry = new THREE.BufferGeometry() ;
ORIG_Geometry.setFromPoints( points_array) ;
var ORIG_Material = new THREE.PointsMaterial({ size: 5, sizeAttenuation : true, color : new THREE.Color( 0x000000)});
ORIG = new THREE.Points( ORIG_Geometry, ORIG_Material) ;
SetOrig( ORIG) ;
// creazione sistema di riferimento nell'origine
const axesHelper = new THREE.AxesHelper( 75 ) ;
axesHelper.rotation.set( -Math.PI/2, 0 ,0) ;
axesHelper.position.set( ORIG.position.x, ORIG.position.y, ORIG.position.z) ;
scene.add( axesHelper );
// creazione della griglia (V1 = finita, V2 = infinita)
const size = 1000000 ;
const divisions = 10000 ;
if ( ! m_bGrid_v1) {
// GRIGLIA INFINITA
const gridHelper = new THREE.GridHelper( size, divisions) ;
gridHelper.position.set( ORIG.position.x, ORIG.position.y, ORIG.position.z) ;
gridHelper.material.transparent = true ;
gridHelper.material.opacity = 0.25 ;
setFog() ;
scene.add( gridHelper) ;
}
else {
// GRIGLIA FINITA
// prendo dimensione del Box
var dDimX = Math.abs( GLBox3D.max.x - GLBox3D.min.x) ;
var dDimY = Math.abs( GLBox3D.max.y - GLBox3D.min.y) ;
var dDimZ = Math.abs( GLBox3D.max.z - GLBox3D.min.z) ;
var dDim = 1.5 * Math.sqrt( dDimX * dDimX + dDimY * dDimY + dDimZ * dDimZ) ;
const gridHelper = new THREE.GridHelper( dDim, Math.ceil( 0.1 * dDim)) ;
gridHelper.position.set( ORIG.position.x + 0.5 * dDim , ORIG.position.y, ORIG.position.z - 0.5 * dDim) ;
gridHelper.material.transparent = true ;
gridHelper.material.opacity = 0.45 ;
scene.add( gridHelper) ;
}
render();
// TEST ===================================
setCameraZoom(m_bZoom);
setCameraPan(m_bPan);
setCameraRot(m_bRot);
setCameraAutoRot(m_bAutoRot);
SetCameraPos( m_nCameraStartPos, ORIG) ;
// =========================================
//console.log('aggiunto 1');
}
function refreshElement(nStart, nEnd) {
//console.log(parseInt(nStart));
for (var i = 0; i < layer_list.length; ++i) {
if (parseInt(layer_list[i].children[0].nLayer) >= parseInt(nStart) &&
parseInt(layer_list[i].children[0].nLayer) <= parseInt(nEnd)) {
layer_list[i].visible = true;
}
else {
layer_list[i].visible = false;
}
}
render();
}
// Utility functions
function onWindowResize() {
}
function render() {
renderer.render(scene, activeCamera);
}
function setCameraZoom(bZoom) {
controls.enableZoom = bZoom;
}
function setCameraPan(bPan) {
controls.enablePan = bPan;
}
function setCameraRot(bRot) {
controls.enableRotate = bRot;
}
function setCameraAutoRot(bAutoRot) {
controls.autoRotate = bAutoRot;
}
function SetCameraPos( nPos, ORIG) {
var nTraslFactor = 3.5 ;
var x ; var y ; var z ;
y = GLBox3D.max.y ; // fixed
switch( nPos) {
case 0 :
x = GLBox3D.min.x ;
z = 0.5 * ( GLBox3D.min.z + GLBox3D.max.z) ;
break ;
case 1 :
x = GLBox3D.min.x ;
z = GLBox3D.max.z ;
break ;
case 2 :
x = 0.5 * ( GLBox3D.min.x + GLBox3D.max.x) ;
z = GLBox3D.max.z ;
break ;
case 3 :
x = GLBox3D.max.x ;
z = GLBox3D.max.z ;
break ;
case 4 :
x = GLBox3D.max.x ;
z = 0.5 * ( GLBox3D.min.z + GLBox3D.max.z) ;
break ;
case 5 :
x = GLBox3D.max.x ;
z = GLBox3D.min.z ;
break ;
case 6 :
x = 0.5 * ( GLBox3D.min.x + GLBox3D.max.x) ;
z = GLBox3D.min.z ;
break ;
case 7 :
x = GLBox3D.min.x ;
z = GLBox3D.min.z ;
break ;
case 8 : // optimal
x = ( ORIG.position.x + 1.0 * Math.abs( GLBox3D.max.x - GLBox3D.min.x)) ;
z = ( ORIG.position.z + 1.0 * Math.abs( GLBox3D.max.z - GLBox3D.min.z)) ;
break ;
default :
return ;
}
var vtPos = new THREE.Vector3( x, y, z) ;
const vtCenter = new THREE.Vector3( 0, 0, 0) ; GLBox3D.getCenter( vtCenter) ;
var vtDirOut = new THREE.Vector3( vtPos.x - vtCenter.x, vtPos.y - vtCenter.y, vtPos.z - vtCenter.z) ;
vtDirOut.x *= nTraslFactor ; vtDirOut.y *= nTraslFactor ; vtDirOut.z *= nTraslFactor ;
//vtDirOut *= nTraslFactor ;
//x *= nTraslFactor ;
//y *= nTraslFactor ;
//z *= nTraslFactor ;
activeCamera.position.set( x + vtDirOut.x, y + vtDirOut.y, z + vtDirOut.z) ;
controls.target.set( vtCenter.x, vtCenter.y, vtCenter.z) ;
console.log( controls) ;
controls.update() ;
}
function SetOrig( ORIG) {
// qui in qualche modo imposto l'origine, ora impostata secondo il BozHelper
// ---- codice da cambiare
var posX = GLBox3D.min.x - 0.3 * ( GLBox3D.max.x - GLBox3D.min.x) ;
var posY = 0 ;
var posZ = GLBox3D.min.z + 1.3 * ( GLBox3D.max.z - GLBox3D.min.z) ;
//ORIG.geometry.translate( posX, posY, posZ) ;
ORIG.position.set( posX, posY, posZ) ;
// -----------------------
//scene.add( ORIG) ;
}
function setFog() {
var dNear = GLBox3D.max.x + 3 * ( GLBox3D.max.x - GLBox3D.min.x) ;
var dFar = 10000 ;
scene.fog = new THREE.Fog( 0xa0a0a0, 20000, 30000);
}
@@ -127,7 +127,7 @@ function setLoaders() {
cDiv[i].style.border = '#afc5d6';
cDiv[i].style.backgroundSize = 'contain';
cDiv[i].style.backgroundImage = 'url(~/styles/LogoClassic_NoText.png)'
cDiv[i].style.backgroundImage = 'url(images/LogoClassic_NoText.png)'
}
}
@@ -151,7 +151,7 @@ function init() {
let startTime = performance.now();
return new Promise(() => {
setTimeout(() => {
loader.load('~/models/3mf/' + fName, function (object) {
loader.load('3mf/' + fName, function (object) {
object.rotation.set(-Math.PI / 2, 0, 0);
object.traverse(function (child) {
child.castShadow = true;

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Some files were not shown because too many files have changed in this diff Show More