Closed jlpoolen closed 5 months ago
The sharing url is hard-coded in the code. You can make a fork and update this the way you need. You probably only need to modify this file: https://github.com/kovacsv/Online3DViewer/blob/master/source/website/sharingdialog.js
I installed this super project on my server and find that if I want to share my model, it appears as if the model has to be processed through your domain: 3dviewer.net ...
Thank you.
[Edited: revised Steps 3 & 4 to include error message when attempting to share a locally loaded file.]
I should have indicated how I set up the server so others reading this Issue can duplicate:
1) in directory /usr/local/src:
git clone https://github.com/kovacsv/Online3DViewer.git
2) in my Apache's htdocs directory, create a link to the project. The manner of accessing the project is critical:
/var/www/salemdata.us/htdocs # ln -s /usr/local/src/Online3DViewer/website 3dviewerB
Note: I linked to the top of the project, e.g. /usr/local/src/Online3DViewer, and then the URL to invoke the project correctly is my server + "3dviewer/website", e.g. https://salemdata.us/3dviewer/website/. I wanted to shorten the URL and remove a directory, so I tried to link directly to the directory "website" with the creation of the link "3dviewerB" that would be accessed with https://salemdata.us/3dviewerB/ and the unfortunate result was a corrupted page:
So, it is necessary to point to the top of the project, and then include in the URL "website". At least for now. I'm still exploring this project and I am very impressed with what @kovacsv has created (one-time Patreon minimal donation forthcoming). I followed his suggestion, but rather than fork the project, I just copied what I had staged into a separate directory and changed my soft links. When I started to try and remove the "website" directory in the link, I ran into trouble and got the corrupted page above, so I thought I should share my efforts here so someone else trying to accomplish what I am does not encounter the same problem. I'm not familiar with Node, so what may be standard operating procedure for a developer using Node.js is something I have to grapple with.
Please find the setup instructions in the developer documentation.
After the code modification you need to call npm run create_package
. This will generate the entire package in the build
folder and this is what you can publish on a web server.
Please find the setup instructions in the developer documentation.
After the code modification you need to call
npm run create_package
. This will generate the entire package in thebuild
folder and this is what you can publish on a web server.
Thank you.
Here's the replacement I made:
janus /usr/local/src/Online3DViewerJLP # date
Sun Apr 7 06:37:11 PM PDT 2024
janus /usr/local/src/Online3DViewerJLP # diff source/website/sharingdialog.js /usr/local/src/Online3DViewer/source/website/sharingdialog.js
46c46
< return 'https://salemdata.us/3dviewer/#' + hashParameters;
---
> return 'https://3dviewer.net/#' + hashParameters;
83c83
< embeddingCode += ' src="https://salemdata.us/3dviewer/embed.html#' + hashParameters + '">';
---
> embeddingCode += ' src="https://3dviewer.net/embed.html#' + hashParameters + '">';
janus /usr/local/src/Online3DViewerJLP #
I ran npm run create_package
and then I created this softlink that points to the correct directory:
ln -s /usr/local/src/Online3DViewerJLP/build/package/website /var/www/salemdata.us/htdocs/3dviewer
Also, in the "built" website directory, there is no ".htaccess" with redirects, so the ".htaccess" file I found under [PROJECT]./website/.htaccess appears to be a file used solely for your development/deployment.
Closing this ticket as I have a working solution that is easily created. Thank you, again.
I installed this super project on my server and find that if I want to share my model, it appears as if the model has to be processed through your domain: 3dviewer.net
Here are the steps I went through:
1) visit my local URL at salemdata.us:
2) Loaded a file from my desktop:
3) Tried to share -- got error message that model has to be loaded via a URL:
4a) Staged my file on my server and then used a URL to load into my instance of Online 3D Viewer:
4b) File from my URL appears fine:
5) Tried to share. Found the value using the 1st option "Sharing Link" contains a link to 3dviewer.net:
6) Found the value using the 2nd options (with & with the "Use customized settings" checked):
The value of the "Sharing Link" field is:
` The value of the Embedded code with "Use customized settings" **UN**checked is: `` In all cases, it looks as though any "shares" generate URLs that point to the domain: 3dviewer.net Question: Is there a way to run this viewer on one's server without having "Share" URLs including reference to "**3dviewer.net**"? I would like to be able to share privately without a call to 3dviewer.net . Thank you. [Edited: revised Steps 3 & 4 to include error message when attempting to share a locally loaded file.]https://3dviewer.net/#model=https://salemdata.us/models/faceplate_202403090853-Body_FaceplatePocket-WeepHole.stl
The value of the Embedded code with "Use customized settings" checked is: `