Giter VIP home page Giter VIP logo

ng2-adsk-forge-viewer's People

Contributors

alansmithnbs avatar angular-cli avatar dependabot[bot] avatar dmh126 avatar wladiarce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng2-adsk-forge-viewer's Issues

Peer Dependencies update

Request:
Bump peerDependencies to Angular 15 in package.json

"peerDependencies": {
"@angular/common": "^15.2.4",
"@angular/core": "^15.2.4",
}

Example of simple geometry creation

Hello I am new to THREE, I want to create a simple 2d Geometry using forge in angular.

I created an extention and tried doing this.

private addToScene() {
     const geom = new THREE.SphereGeometry(10, 8, 8);
     const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
     const sphereMesh = new THREE.Mesh(geom, material);
     sphereMesh.position.set(1, 2, 3);
     this.viewer.impl.createOverlayScene('custom-scene');
     this.viewer.impl.addOverlay('custom-scene', sphereMesh);
     this.viewer.impl.invalidate(true);
}

I get the below error message

three.js:35 THREE.Object3D.add: object not an instance of THREE.Object3D. Mesh {uuid: "1CA8B8ED-5370-45FE-B20C-BB6AF483716E", name: "", type: "Mesh", parent: null, children: Array(0), …}

Loading extension with configuration

Hi,

I 'm using your viewer component and I like it very much.
But I do have one question.

How can I load an extension(difftool) that requires a config class?

I cant register it on ViewerScriptsLoaded since I need the loaded models in the config files. If I load the extension on the geometry loaded event I get a leaking viewer error (errorcode 14) with event.target.loadextension(). Is there something I m missing? I can provide some code if I m not making sense.

King regards,
Josip

Two Forge Viewer in single application

I am enable to create two Forge Viewer in single application. I have created two viewer but all model loads only in first Forge viewer and second Forge viewer is not working. I think the issue is Angular Forge Viewer component is using same container Id.

I am using ng2-adsk-forge-viewer npm library. so kindly suggest any solution or idea that can be worked.

Aggregate multi models in sequence in Forge Viewer

Hi Team, I'm trying to add multi models in one Viewer, but the component not Public the Autodesk.Viewing.Document in ViewerInitializedEvent

export interface ViewerInitializedEvent {
viewerComponent: ViewerComponent;
viewer: Autodesk.Viewing.Viewer3D;
}

So, I can't using Autodesk.Viewing.Document.load method to custom the Geometry (globalOffset) of models before load it in Viewer. I think this will give you an idea for the next version.
https://forge.autodesk.com/blog/aggregate-multi-models-sequence-forge-viewer

Kind regards 👍

How to load some Extensions ?

I'm sorry for the question but I do not understand how to load, for example, 2 extensions.

I've create 2 files : hello.extension.ts and good-bye.extension.ts

I've try to inject in the ctor of the AppComponent but It's not working because of the missing provider (normal)

Can you explain how to do it?

Thanks for your code and your help !

Get viewer container from Extension

hi and thanks for adding the features with the UI buttons :) Seems to work.

But I found out when I was trying the get the HTML element from the viewer (usually viewer.container) that is was not implemented in the typings.ts. I need it to create a new dockingpanel

Is this something you can add quickly ?

thanks
br Mattias

Can't compile in Angular 7

Trying to compile in angular 7.

It gives an error in rxjs/Observables and so..
If I change it to rxjs it compiles fine.

Can you fix it?

Invite to contribute to official definitions

Hi Alan,

I am Bryan Huang from Autodesk Developer Network. Hope this finds you well.

In response to community feedback we are working on official TypeScript definitions for our Forge SDK and Viewer.js which will be released to DefinitelyTyped once done. Here’s our preliminary work so far:
https://github.com/cyrillef/forge-api.typescript

So I am wondering - seeing what you’ve done here which is so amazing BTW - if you’d like to contribute to our official work? Feel free to drop me a line on [email protected] if you’d like to continue our conversation in private. Look forward to hearing from you!

Cheers,
Bryan

advanced example?

Can you share some advanced examples?
i.e.:

  • using a request parameter, how to search inside a metadata to open in a specific point of view?
  • how to see all thumbnails?
  • how to open a card with a single object properties

How to get viewer class for another component

Hi team,
How can i get viewer class to use for another component? I want another component has a function to change model in Viewer, so i need that class to access data.
Appreciate your hard working.

Support for newer Angular versions (^9)

Is your feature request related to a problem? Please describe.
Currently Angular v8 is no longer under support. Versions 9, 10, 11 are now supported.

Describe the solution you'd like
Support for newer versions of Angular

Describe alternatives you've considered
None.

Additional context

Remove HttpClientModule from ViewerModule imports

Is your feature request related to a problem? Please describe.
Due to the HttpClientModule import in the ViewerModule, app lazy-loaded modules that include ViewerModule get a different instance of HttpClient Service. This leads to a change of the global HttpInterceptor Service behavior, etc.

Describe the solution you'd like
Remove HttpClientModule from ViewerModule imports and require importing HttpClientModule manually in the root application module (AppModule).

Additional context
Made a patch with patch-package lib and successfully fixed the issue in the existing app with Viewer.

UI.Button is not available

Is your feature request related to a problem? Please describe.
We are using your module to use forge viewer in a SharePoint framework webpart but a requirement led to that we needed to add a button to the toolbar. However this was not implemented when I looked through the module

Describe the solution you'd like
Add Autodes.Viewing.UI.Button to module

Viewer always 100% of viewport size.

I am trying to add the viewer to a page with a title bar and left menu pane, but the viewer canvas is sizing to the viewport size, so I have scrollbars.

I have a div that is the expected size. Inside it <adsk-forge-viewer> is 0x0, <div id=ng2-adsk-forge-viewer-container> is the expected width but has 0 height.

Then inside that is <div class="adsk-viewing-viewer2> which has 100% height and width, but is the viewport size. I think it is sizing to the canvas that it contains.

I can fix it by adding

#ng2-adsk-forge-viewer-container {
    height: 100%;
    width: 100%;
    position: relative;
}

to viewer.component.css and placing the viewer in a div with height: calc(100vh-45)

but I can't see how to get the viewer though npm and add this css from my code to a child component without using the deprecated deep selectors.

Am I missing something really obvious?

Cors issues fetching from

Hello :)

I have some CORS issues fetching from the FORGE api with your package. below is the code I am using to fetch from the api
image

How should we solve this CORS issue?

      this.viewerOptions = {
            initializerOptions: {
                env: 'AutodeskProduction',
                getAccessToken: (onGetAccessToken: (token: string, expire: number) => void) => {
                    const expireTimeSeconds = 60 * 30;
                    onGetAccessToken(ACCESS_TOKEN, expireTimeSeconds);
                },

                api: 'derivativeV2',
                enableMemoryManagement: true,
            },
            viewerConfig: {
                extensions: [
                    
                ],
                theme: 'bim-theme',
            },
            onViewerScriptsLoaded: () => {

            },
            onViewerInitialized: (args: ViewerInitializedEvent) => {
                args.viewerComponent.DocumentId = this.documentId;
                //Create list in viewer details
                args.viewerComponent.onObjectTreeCreated.subscribe(event => {
                    this.documentChanged(args);
                });
                args.viewerComponent.onGeometryLoaded.subscribe(event => {
                    if (this.elements.length <= 0) {
                        this.showWarning = true;
                    }
                    this.eventEmitterService.onInvokeUpdateElements(this.elements);
                    this.loaderService.removeLoader("viewerLoader");
                })
            },
        };

Build error

I have an error while importing to to appmodule

ERROR in node_modules/ng2-adsk-forge-viewer/lib/component/viewer.component.d.ts(1,23): error TS2688: Cannot find type definition file for 'forge-viewer'.
node_modules/ng2-adsk-forge-viewer/lib/component/viewer.component.d.ts(8,15): error TS2503: Cannot find namespace 'Autodesk'.
node_modules/ng2-adsk-forge-viewer/lib/component/viewer.component.d.ts(10,13): error TS2503: Cannot find namespace 'Autodesk'.
node_modules/ng2-adsk-forge-viewer/lib/component/viewer.component.d.ts(13,11): error TS2503: Cannot find namespace 'Autodesk'.

How can I fix this?

Seeking a way to get instance of `Autodesk` for ToolInterface implmentation

Is your feature request related to a problem? Please describe.
I'm trying to create a tool class which extends Autodesk.Viewing.ToolInterface like this:

export class MyTool extends Autodesk.Viewing.ToolInterface {
}

then register/wrap it by an extension like this:

export class MyToolExtension extends Extension {
      private tool = new MyTool();
      
    load() {
         (this.viewer as Autodesk.Viewing.GuiViewer3D).toolController.registerTool(this.tool);
    }
}

Because I have only installed ng2-adsk-forge-viewer and "@types/forge-viewer": "^7.48.0",, it's complaining that Autodesk is undefined.

Describe the solution you'd like

I was wondering if there's a way to directly export Autodesk from ng2-adsk-forge-viewer like I do this import { Extension } from 'ng2-adsk-forge-viewer';?

Describe alternatives you've considered
If there's no way to re-export Autodesk from 'ng2-adsk-forge-viewer', I might need to include a copy of Autodesk in my main repo. Any concerns/comments there?

Additional context
Really appreciate your work here! Everything looks amazing so far.
Do have a non-blocker question, is the viewer in Extension class actually a GuiViewer3D(that has toolController), not just Viewer3D(that doesn't have toolController)?

Thank you tons!

FYI: I can help to contribute! But I can't find README_dev.md in this Repo, did I miss something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.