The Speckle Server, Frontend, 3D Viewer, & other JS utilities.
Перейти к файлу
Alexandru Popovici dba377aaec
Alex/#1658 Frontend Integration Performance Increase (#1670)
* WIP on measurements. Got some basic functionalities going

* New update for measurements. We're no showing multiple lines towards the measurement endpoint for better reference. Added dotted lines. Added text. Added measurement end and start points. Added the possibility to add multiple measurements.

* When double clicking, Input will not ignore the second click and will not send a click event. It will send the first click event, then a double click event. Implemented auto perpendicular measurement by using double click

* Added the option to have fixed sized measurement gizmos. As in, the are the same size regardless of the camera zoom. Implemented gizmo styles which lets us control and change at runtime the way the gizmos look. Currently they're only programatic, but I'll add controls for them in the sandbox next

* Implemented measurement management. Added picking, cancelling, removing and highlighting of measurements. Measurements are all now on their special ObjectLayer

* Added frame lock, so mouse events do not trigger intersection tests more than once per frame for the measurements. Added opacity options in the measurement gizmos. Made the end gizmo line transparent by default. Added preprocessor macro in the line shader which enables opacity as a uniform as opposed to attribute only like we had it before

* Point is now fixed size when style imposes it

* WIP on text aligning with the line. Still needs some things to be clarified since it can get complicated. Fixed some color issues. Added a maximum constraint to the screen space gizmo sizes. It's empirical, but seems to be workign decently for the all the various stream sizes I've trid

* Measurement gizmo now flashes red a few times if requrested to auto-lazer and no intersection was found

* Added unit conversion to measurment text, unit display and precision

* Implemented proper billboarding (fixed size and non fixed size) in the text and basic vertex programs as well as support for them in the text and basic speckle materials. Overhauled how the measurements look based on the forge reference

* Split measurements by type and added an abstract superclass. Point to point measurement has it's own implementation now

* Implemented screen space snapping for point to point measurements. Text background now gets dyanamically resized when needed

* End point gizmo is now only shown when required

* Added clamp guard to acos since dot can return outside of [-1,1] due to fp precision issues. Fixed an issue where existing measurements could be selected in the process of creating another measurement

* Added function for adding measurements programatically. Currently only start and end point make sense as measuremetn data

* Added an 100nm offset from the original point along the surface normal for auto-lazer function because sometimes it would intersect itself and report incorrect length

* Separated all measurement related rendering into a separate 'Overlay' pass. We now have better control over the rendering order of the individal elements of the measurement gizmos. This fixed the issue of having the measurement line overlap the end points

* Billboarded shaders now also work correctly with section planes

* Measurement tool no longer considers surfaces clipped by the section box

* Implemented correct raycasting for billboarded and fixed sized bibboarded objects, like the measurement's text

* Implemented zooming in to measurements when double clicking

* Big update to measurements which addresses most if not all requirements regarding UX/UI, API, and generaly functionalities. Additionally, a fix or an ancient issue in Units where kilometers were incorrectly calculated, and added automatically resolution updates to the SpeckleLineMaterial

* Added dpr factor into billboard size calculations. Fixed an issue with the round rect geometry generation function which would fail on macos. Added the billboard text background size into the text's style so it's configurable

* Text can now be updated for perpendicular measurements also when in it's complete state

* Fixed an exception which was thorwn when double clicking on another measurement while measuring

* When changing the measurement type while the measurement is still in it's dangling start state, the measurement gets cancelled and a new one with the new type gets started. If the measurement is in it's dangling end state, then it does not. This is now forge viewer does it

* Implemented screen space surface normal indicator line

* Measurements now work on visible and non-ghosted objects. Removed the surface normal indicator from the point to point measurement

* Fixed an issue with orthogrtaphic camera and NDC normal computation. Implemented fixed sized gizmo disc for orthographic camera

* Fixed an issue where the pipeline would not get properly reset after zooming in orthographic mode

* Fixed some regressions with the pre-existing application measurements functionalit and text. Fixed an issue where auto-lazer measurements were not vertically centered.

* Replaced the full blown copy method from SpeckleMesh's cached material with a faster version which *should* work just the sam

* Added optional copying of cached materials defaulting to false

* Implemented the option to insert draw ranges in batches. This is how selecting objects now works in order to avoid re-applying existing filters pointlessly. The onyl downside is that this introduces extra draw calls and overdraw, but it does not interfere with the existing draw range setting systems. We do make an attempy to minimize extra draw call count which works for most scenarios. With this change, we've removed selecting/unselecting objects from the generic setFilters approach in FilteringManager

* Apply any pre-existing selection filter after applying the rest of the filters

* Improved 'setNumericColorFilter' and 'setStringColorFilter' function performance by 10x. The culprit was calling 'indexOf' in the tree walk callback which apparently is very slow even for arrays with only a few thousand elements. By using direct indexing we eliminated the ridiculous overhead

* Performance increase of about 20x to isolating, hiding, unisolating and unhiding. Still WIP, the UI got messed up a bit

* Correct length of visibility ids

* Fixed an issue with un-isolating and un-hiding

* Did the same thing for highlight as I did for selection, where we take it out of the setFilters flow and apply direct filters on the rvs

* Removed timings

* Small fix for color filters

* Implemented inserting and removing draw ranges from the line batch

* Implemented draw range insertion and removel for the point batch

* Implemented draw range insertion and removel for TextBatch. Fixed an issue with inserting draw ranges in the batcher

* Fixed diffing colours which got screwed during this PR. Additionally made an even faster version for copying materials which has virtually no overhead
2023-07-10 12:55:38 +03:00
.circleci chore(node): bump to 18.16.1 (#1675) 2023-07-07 16:54:18 +01:00
.github Update Github Actions to use the actions repo (#1325) 2023-01-19 11:33:45 +00:00
.husky Adds gitguardian ggshield pre-commit hook (#912) 2022-10-25 13:41:00 +01:00
.vscode feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03:00
.yarn gergo/yarn (#753) 2022-05-19 19:53:07 +02:00
packages Alex/#1658 Frontend Integration Performance Increase (#1670) 2023-07-10 12:55:38 +03:00
setup/db chore(server): better naming for the sql init script 2022-03-17 13:20:35 +02:00
test-queries fix(tests & queries): added graphql handlers for object children, tests, and refactoring 2020-05-13 14:19:46 +01:00
utils fix(docker compose): set minimum compose version as '3' (#1677) 2023-07-10 10:29:10 +01:00
.dockerignore gergo/pgTimeout (#805) 2022-06-17 08:38:34 +02:00
.editorconfig frontend nginx improvement (#185) 2021-04-20 21:10:36 +03:00
.eslintrc.js feat: dui3 package (#1585) 2023-05-19 16:57:28 +03:00
.gitguardian.yml Adds gitguardian ggshield pre-commit hook (#912) 2022-10-25 13:41:00 +01:00
.gitignore chore(gitignore): ignore temporary vite config files (#1624) 2023-06-13 11:24:50 +01:00
.graphqlrc feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03:00
.pre-commit-config.yaml feat(helm): configure inspect flag for server via helm chart (#1593) 2023-06-01 21:43:22 +01:00
.prettierignore feat: dui3 package (#1585) 2023-05-19 16:57:28 +03:00
.prettierrc chore: re-formatted everything with prettier 2022-03-30 12:54:24 +03:00
.yarnrc.yml gergo/yarn (#753) 2022-05-19 19:53:07 +02:00
CONTRIBUTING.md Fix various typos 2021-07-22 09:23:21 -04:00
LICENSE Create LICENSE 2020-08-26 14:24:39 +03:00
README.md Adds gitguardian ggshield pre-commit hook (#912) 2022-10-25 13:41:00 +01:00
SECURITY.md chore: re-formatted everything with prettier 2022-03-30 12:54:24 +03:00
docker-compose-deps.yml feat(server): add speckle automate as a configurable default app (#1540) 2023-04-19 12:59:59 +02:00
docker-compose-speckle.yml fix(docker compose): set minimum compose version as '3' (#1677) 2023-07-10 10:29:10 +01:00
jsconfig.base.json feat: Standardized & cleaned up formatting & linting across repo #617 (#618) 2022-03-16 10:10:30 +02:00
lint-staged.config.js feat: tailwind theme & Vue base components extracted to own NPM packages (#1576) 2023-05-16 13:43:04 +03:00
package.json chore(node): bump to 18.16.1 (#1675) 2023-07-07 16:54:18 +01:00
vetur.config.js feat(frontend): typescript support in frontend (#803) 2022-06-14 17:30:51 +03:00
workspace.code-workspace fix(fe1): log out on invalid auth token 2023-06-30 11:23:23 +03:00
yarn.lock fix(viewer): fixed three.js imports to hopefully fix fe2 (#1660) 2023-06-28 16:04:29 +03:00

README.md


Speckle | Server

Server and Web packages

Speckle is data infrastructure for the AEC industry.


Twitter Follow Community forum users website docs

Speckle-Next codecov codecov

About Speckle

What is Speckle? Check our YouTube Video Views

Features

  • Object-based: say goodbye to files! Speckle is the first object based platform for the AEC industry
  • Version control: Speckle is the Git & Hub for geometry and BIM data
  • Collaboration: share your designs collaborate with others
  • 3D Viewer: see your CAD and BIM models online, share and embed them anywhere
  • Interoperability: get your CAD and BIM models into other software without exporting or importing
  • Real time: get real time updates and notifications and changes
  • GraphQL API: get what you need anywhere you want it
  • Webhooks: the base for a automation and next-gen pipelines
  • Built for developers: we are building Speckle with developers in mind and got tools for every stack
  • Built for the AEC industry: Speckle connectors are plugins for the most common software used in the industry such as Revit, Rhino, Grasshopper, AutoCAD, Civil 3D, Excel, Unreal Engine, Unity, QGIS, Blender, ArchiCAD and more!

Try Speckle now!

Give Speckle a try in no time by:

  • speckle XYZ ⇒ creating an account at
  • create a droplet ⇒ deploying an instance in 1 click

Resources

  • Community forum users for help, feature requests or just to hang with other speckle enthusiasts, check out our community forum!
  • website our tutorials portal is full of resources to get you started using Speckle
  • docs reference on almost any end-user and developer functionality

Repo structure

This monorepo is the home of the Speckle v2 web packages:

Other repos

Make sure to also check and these other Speckle repositories:

Developing and Debugging

Have you checked our dev docs?

We have a detailed section on deploying a Speckle server. To get started developing locally, you can see the Local development environment page.

TL;DR;

We're using yarn and its workspaces functionalities to manage the monorepo. Make sure you are using nodejs 16+. To get started, run:

$ corepack enable $ yarn $ yarn build

After this, you can use the scripts in the individual packages or run all in dev mode: $ yarn dev

For development you'll also want to run yarn dev:docker:up which will start up the docker containers you will need to be able to run the apps on your machine.

IDE

The suggested IDE for working in this repo is VSCode, because the repo has special configs to improve the DX there (auto-format & auto-lint, recommended extensions etc.).

This repository relies on VSCode multi-root workspaces, so for the best DX and proper formatting/linting make sure you open the project using the workspace.code-workspace file instead of just opening the folder in VSCode.

Proper TypeScript support

To get proper TS support in standard TS files as well as Vue files, we rely on the Volar VSCode extension - not Vetur! When you open the workspace for the very first time, VSCode should already prompt you to install this extension. The default Volar setup can be quite resource intensive, however, because there end up being standard TS Language Server instances running as well as Vue TS Language server instances. To resolve this issue we rely on Volar's Take Over Mode.

Essentially, ensure you have Volar enabled, and the built in TypeScript and JavaScript Language Features extension disabled (for this workspace)!

Useful containers

Maildev

We have a Maildev container available that you can use to see all e-mails sent out from the app. Make sure your server .env file is configured properly to use it:

EMAIL=true
EMAIL_FROM="speckle@speckle.local"
EMAIL_HOST="localhost"
EMAIL_PORT="1025"

The web portal is available at localhost:1080 and it's listening for mail on port 1025.

Contributing

Please make sure you read the contribution guidelines for an overview of the best practices we try to follow.

When pushing commits to this repo, please follow the following guidelines:

  • When ready to commit, run $ yarn cz & follow the prompts.

When committing to git, an automated script will run. This will check that your commit conforms to Speckle's guidelines.

  • To enable additional checks, you may wish to optionally install the following:
  • Please note that these additional checks will be run by Speckle's automated CI environment and non-conformances, if any, may prevent your Pull Request from being merged.
  • Please use the name of the package as the scope of your commit.
  • Note that ggshield requires you to register an account and then authorise with GitGuardian before it can be used: ggshield auth login

Security

For any security vulnerabilities or concerns, please contact us directly at security[at]speckle.systems.

License

Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via email.