diff --git a/README.md b/README.md index 4844130..05b6984 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The repository is separated into two parts. ## Supported file formats -* **Import**: obj, 3ds, stl, ply, gltf, glb, off, 3dm, fbx, dae, wrl, 3mf, ifc, brep, step, iges, fcstd, bim. +* **Import**: obj, 3ds, stl, ply, gltf, glb, off, 3dm, fbx, dae, wrl, 3mf, amf, ifc, brep, step, iges, fcstd, bim. * **Export**: obj, stl, ply, gltf, glb, off, 3dm, bim. ## Features diff --git a/assets/images/ecosystem.png b/assets/images/ecosystem.png index 8a79fc8..f90f1ec 100644 Binary files a/assets/images/ecosystem.png and b/assets/images/ecosystem.png differ diff --git a/assets/images/ecosystem.svg b/assets/images/ecosystem.svg index dd22163..c4bbe43 100644 --- a/assets/images/ecosystem.svg +++ b/assets/images/ecosystem.svg @@ -9,7 +9,7 @@ id="svg8" inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)" sodipodi:docname="ecosystem.svg" - inkscape:export-filename="C:\Users\Viktor\GitRepos\Online3DViewer\assets\images\ecosystem.png" + inkscape:export-filename="ecosystem.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -250,6 +250,20 @@ d="M 5.77,0 -2.88,5 V -5 Z" id="path2134-5-5-1" /> + + + + x="-5.0862632e-06" + y="191.16666" /> + transform="matrix(0.89638857,0,0,0.89638857,188.36047,314.93745)"> obj + y="295.08487">obj ply + y="328.21573">ply glb + y="361.35715">glb 3dm + y="395.50397">3dm bim + y="412.0694">bim off + y="378.91211">off stl + y="312.65042">stl gltf + y="344.78644">gltf 3ds + x="41.58609" + y="229.53226">3ds obj + x="81.195847" + y="211.96672">obj stl + x="83.365425" + y="246.10298">stl ply + x="42.67617" + y="261.6683">ply gltf + x="80.449745" + y="278.23901">gltf 3dm + x="37.930984" + y="295.96994">3dm fbx + x="79.609787" + y="312.53537">fbx dae + x="39.206268" + y="329.11136">dae wrl + x="80.165405" + y="345.7341">wrl 3mf + x="38.904648" + y="362.23163">3mf amf + ifc + x="43.633755" + y="395.35812">ifc step + x="77.334618" + y="410.59818">step iges + x="39.117249" + y="427.2981">iges brep + x="76.427696" + y="444.04449">brep + + bim + x="78.714386" + y="478.17035">bim fcstd + x="37.556637" + y="461.62546">fcstd off + x="42.633831" + y="494.76688">off diff --git a/package.json b/package.json index 0c10ad9..e9f2155 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "dae", "wrl", "3mf", + "amf", "ifc", "brep", "step", diff --git a/source/engine/import/importer.js b/source/engine/import/importer.js index c972aec..2cd1758 100644 --- a/source/engine/import/importer.js +++ b/source/engine/import/importer.js @@ -12,7 +12,7 @@ import { ImporterPly } from './importerply.js'; import { ImporterOcct } from './importerocct.js'; import { ImporterStl } from './importerstl.js'; import { ImporterBim } from './importerbim.js'; -import { ImporterThree3mf, ImporterThreeDae, ImporterThreeFbx, ImporterThreeWrl } from './importerthree.js'; +import { ImporterThreeAmf, ImporterThree3mf, ImporterThreeDae, ImporterThreeFbx, ImporterThreeWrl } from './importerthree.js'; import * as fflate from 'fflate'; import { ImporterFcstd } from './importerfcstd.js'; @@ -94,7 +94,8 @@ export class Importer new ImporterThreeFbx (), new ImporterThreeDae (), new ImporterThreeWrl (), - new ImporterThree3mf () + new ImporterThree3mf (), + new ImporterThreeAmf () ]; this.fileList = new ImporterFileList (); this.model = null; diff --git a/source/engine/import/importerthree.js b/source/engine/import/importerthree.js index 22b0f5b..b0d28a9 100644 --- a/source/engine/import/importerthree.js +++ b/source/engine/import/importerthree.js @@ -15,6 +15,7 @@ import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js'; import { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js'; import { VRMLLoader } from 'three/examples/jsm/loaders/VRMLLoader.js'; import { ThreeMFLoader } from 'three/examples/jsm/loaders/3MFLoader.js'; +import { AMFLoader } from 'three/examples/jsm/loaders/AMFLoader.js'; export class ImporterThreeBase extends ImporterBase { @@ -406,3 +407,31 @@ export class ImporterThree3mf extends ImporterThreeBase return loadedObject; } } + +export class ImporterThreeAmf extends ImporterThreeBase +{ + constructor () + { + super (); + } + + CanImportExtension (extension) + { + return extension === 'amf'; + } + + GetUpDirection () + { + return Direction.Z; + } + + CreateLoader (manager) + { + return new AMFLoader (manager); + } + + GetMainObject (loadedObject) + { + return loadedObject; + } +} diff --git a/source/engine/main.js b/source/engine/main.js index 6b02594..f0c05c9 100644 --- a/source/engine/main.js +++ b/source/engine/main.js @@ -36,7 +36,7 @@ import { ImporterOff } from './import/importeroff.js'; import { ImporterPly } from './import/importerply.js'; import { ImporterStl } from './import/importerstl.js'; import { ImporterThreeSvg } from './import/importersvg.js'; -import { ImporterThreeBase, ImporterThreeFbx, ImporterThreeDae, ImporterThreeWrl, ImporterThree3mf } from './import/importerthree.js'; +import { ImporterThreeBase, ImporterThreeFbx, ImporterThreeDae, ImporterThreeWrl, ImporterThree3mf, ImporterThreeAmf } from './import/importerthree.js'; import { ColorToMaterialConverter, NameFromLine, ParametersFromLine, ReadLines, IsPowerOfTwo, NextPowerOfTwo, UpdateMaterialTransparency } from './import/importerutils.js'; import { BinaryReader } from './io/binaryreader.js'; import { BinaryWriter } from './io/binarywriter.js'; @@ -172,6 +172,7 @@ export { ImporterThreeDae, ImporterThreeWrl, ImporterThree3mf, + ImporterThreeAmf, ColorToMaterialConverter, NameFromLine, ParametersFromLine, diff --git a/tools/rollup.js b/tools/rollup.js index d57787a..4ebb835 100644 --- a/tools/rollup.js +++ b/tools/rollup.js @@ -13,7 +13,8 @@ export default [ 'three/examples/jsm/loaders/FBXLoader.js', 'three/examples/jsm/loaders/ColladaLoader.js', 'three/examples/jsm/loaders/VRMLLoader.js', - 'three/examples/jsm/loaders/3MFLoader.js' + 'three/examples/jsm/loaders/3MFLoader.js', + 'three/examples/jsm/loaders/AMFLoader.js' ] } ]; diff --git a/website/info/index.html b/website/info/index.html index 8807466..6456f44 100644 --- a/website/info/index.html +++ b/website/info/index.html @@ -183,6 +183,14 @@ ✗ three.js + + Additive Manufacturing Format + amf + text + ✓ + ✗ + three.js + BREP brep