ZeaInc / zea-svelte-template

This Svelte Template is a preconfigured Svelte app that combines the engine and many of the popular plugins.
https://www.zea.live/en/ecosystem/svelte-template
MIT License
0 stars 0 forks source link

Add a drop file feature to load zcad files and gltf files #37 #45

Closed lgharib closed 3 years ago

cloudflare-workers-and-pages[bot] commented 3 years ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1b325d1
Status: ✅  Deploy successful!
Preview URL: https://b91f16ce.zea-svelte-template.pages.dev

View logs

phtaylor commented 3 years ago

Would it be possible to support dragging a second file over and dropping it? This may be impossible, so I just wanted to check.

moh60 commented 3 years ago

Unable to load all zcad sample datasets

Sucess

'Bounding box not valid'

This issue is resulted from https://cdn.jsdelivr.net/npm/@zeainc/zea-engine@3/src/SceneTree/Camera.js

  /**
   * Calculates a new camera position that frames all the items passed in `treeItems` array, moving
   * the camera to a point where we can see all of them.
   *
   * @param {GLBaseViewport} viewport - The viewport value.
   * @param {array} treeItems - The treeItems value.
   */
  frameView(viewport, treeItems) {
    const boundingBox = new Box3()
    for (const treeItem of treeItems) {
      boundingBox.addBox3(treeItem.getParameter('BoundingBox').getValue())
    }

    if (!boundingBox.isValid()) {
      console.warn('Bounding box not valid.')
      return

}

Is this a known issue? For example https://svelte-template.zea.live/?zcad=%2Fdata%2FFidget-Spinner-2.zcad

phtaylor commented 3 years ago

We updated our zcad file format and this one is just a bit old. I will update it.

moh60 commented 3 years ago

At the moment the solution supports dragging of multiple assets. However, they are currently binded to the same canvas (they will overlap each other if both assets are "visible")

phtaylor commented 3 years ago

image

This is what I get if I drag and drop multiple files. This is great.