Commit Graph

292 Commits

Author SHA1 Message Date
Viktor Kovacs
a39de09715 Add base enumerator class so meshes and models can be handled in the same way for calculations. 2021-05-20 10:07:37 +02:00
Viktor Kovacs
4bceb5b2b2 Fix solid body detection: an edge should appear with different directions in the neighbour triangles. 2021-05-18 17:21:37 +02:00
Viktor Kovacs
9a8e54a804 Minor modification. 2021-05-17 16:55:54 +02:00
Viktor Kovacs
bdef08756a Code for surface area and volume calculation. 2021-05-17 16:05:52 +02:00
Viktor Kovacs
f02b660b23 Add topology calculator. 2021-05-15 19:23:14 +02:00
Viktor Kovacs
39ecb7af61 Add bounding box calculator. 2021-05-15 12:04:48 +02:00
Viktor Kovacs
4ee5eb6040 Bounding box calculation test. 2021-05-15 11:57:00 +02:00
Viktor Kovacs
e7c42dd067 Build fix. 2021-05-15 11:49:00 +02:00
Viktor Kovacs
371044bf67 Move exporter utils content to model utils. 2021-05-15 11:47:43 +02:00
Viktor Kovacs
8937cafdfd Add minimal octree implementation. 2021-05-14 16:58:28 +02:00
Viktor Kovacs
51f42f8505 Revert PNG Transparency #21
It breaks other models, so keep it as it is until a better solution.
2021-05-11 20:47:21 +02:00
Viktor Kovacs
3842e1afcf PNG Transparency #21
Treat materials with png texture automatically as transparent.
2021-05-11 20:43:57 +02:00
Viktor Kovacs
e9509d1696 Use wheel event instead of deprecated DOMMouseScroll and mousewheel. 2021-05-09 15:38:32 +02:00
Viktor Kovacs
31635229af Remove dead code (also contained a typo). 2021-05-09 15:21:59 +02:00
Viktor Kovacs
7b7a989b1e Fix object detection under mouse. 2021-05-05 08:09:08 +02:00
Viktor Kovacs
72e45a8030 Separate class to store geometry. 2021-04-30 07:49:36 +02:00
Viktor Kovacs
482a6958a7 Flip triangles when the model should be mirrored. 2021-04-25 19:52:33 +02:00
Viktor Kovacs
a9aebe77f4 Export mesh names to rhino. 2021-04-25 18:48:10 +02:00
Viktor Kovacs
6f1707ae10 Write double-sided triangles during glTF export #63 2021-04-25 18:45:21 +02:00
Viktor Kovacs
0d329ea37b Add Rhino exporter. 2021-04-25 18:01:52 +02:00
Viktor Kovacs
1bc47cfa08 Aynchronous export. 2021-04-25 16:03:17 +02:00
Viktor Kovacs
b47d6b0ce4 Maintain device pixel ratio during resize, so the render won't be blurry when the users set the scale for the whole webpage. 2021-04-25 15:33:36 +02:00
Viktor Kovacs
ba0d642512
Revert "Add optional edge displaying and settings" 2021-04-25 15:19:17 +02:00
X-Ryl669
8a5782b8ec Add optional edge displaying and settings 2021-04-23 17:55:35 +02:00
Viktor Kovacs
e6452eb39f Modify error message when there are no 3D meshes in the rhino file. 2021-04-22 08:28:17 +02:00
Viktor Kovacs
8c6029d52d Hi-DPI aware #60
Take device pixel ration in consideration when initializing renderer and when saving to a fixed size png.
2021-04-22 08:10:43 +02:00
Viktor Kovacs
78460fe743 Do not take byte stride into account when it is zero. Although it is not valid according to the specification, it seems it can be handled as if byte stride was not specified. 2021-04-20 18:55:32 +02:00
Viktor Kovacs
2740de7098 Handle invalid camera when moving. 2021-04-20 15:20:11 +02:00
Viktor Kovacs
615bab3c4d Do not call camera move when the new camera is invalid. 2021-04-20 15:17:05 +02:00
Viktor Kovacs
ddec4bd898 Clear importer data after import. 2021-04-20 11:48:08 +02:00
Viktor Kovacs
2e85bf20b5 Minor modification. 2021-04-20 10:56:57 +02:00
Viktor Kovacs
edeb864576 Free importer resources after import. 2021-04-20 10:55:03 +02:00
Viktor Kovacs
0372bf81c9 Minor modification. 2021-04-20 08:45:11 +02:00
Viktor Kovacs
c4a0d68a37 Detailed error messages. 2021-04-19 08:32:52 +02:00
Viktor Kovacs
fa015f7fb5 MeshPhongMaterial's shininess should be between 0.0 and 100.0, so I modified the conversion and all of the importers accordingly. 2021-04-17 12:45:40 +02:00
Viktor Kovacs
cf65d1f204 Override diffuse color only it it is completely black. 2021-04-17 12:16:01 +02:00
Viktor Kovacs
fc0aafb4dc Allow fully transparent objects. 2021-04-17 10:34:04 +02:00
Viktor Kovacs
4104197f31 Error handling in case of wrong file. 2021-04-16 18:39:30 +02:00
Viktor Kovacs
1cb267a2b8 Handle SubD objects. 2021-04-16 17:26:04 +02:00
Viktor Kovacs
5956c9f131 Handle different material types. 2021-04-16 17:13:31 +02:00
Viktor Kovacs
3f5d29f9fc Handle instances in rhino importer. 2021-04-16 14:47:18 +02:00
Viktor Kovacs
a5900585f4 Fix up direction for rhino importer. 2021-04-15 21:19:19 +02:00
Viktor Kovacs
33d4d5ac50 Do not use hash mark in material names. 2021-04-15 21:16:56 +02:00
Viktor Kovacs
489269b17f Make material color win over display color. 2021-04-15 20:47:30 +02:00
Viktor Kovacs
a2aaedbbae Rhino import experiment. 2021-04-15 20:23:08 +02:00
Viktor Kovacs
79207aa413 Minor modification. 2021-04-15 14:54:47 +02:00
Viktor Kovacs
bc74ed9b04 Replace tabs with spaces. 2021-04-15 14:53:33 +02:00
Viktor Kovacs
9f9851a2ec Async importers. 2021-04-15 14:52:16 +02:00
Viktor Kovacs
e9305ba33c Export as png #39 2021-04-11 12:24:41 +02:00
Viktor Kovacs
134793d790 Minor modification. 2021-04-11 10:28:29 +02:00
Viktor Kovacs
89aaca6081 Write header in obj and mtl files. 2021-04-11 10:24:43 +02:00
Viktor Kovacs
3607ab3649 Always use texture buffer instead of url in case of export. 2021-04-09 08:25:00 +02:00
Viktor Kovacs
6fbbdf4b69 Make a parameter from default color instead of the a member in importer. 2021-04-07 15:07:12 +02:00
Viktor Kovacs
c958cf549c Write generator tag in asset. 2021-04-06 17:51:45 +02:00
Viktor Kovacs
8a29a6c682 Default color handling (switched off). 2021-04-05 12:22:59 +02:00
Viktor Kovacs
ca4e0ef1d4 Default color handling during embedding and engine usage. 2021-04-05 10:20:26 +02:00
Viktor Kovacs
e5e59f3e5d Get default color from importer. 2021-04-05 09:49:55 +02:00
Viktor Kovacs
2b37ad351e Remove unused function. 2021-04-04 13:02:43 +02:00
Viktor Kovacs
d43477d726 Self-hosted viewers should detect size automatically based on the size of the container div #43
Now the viewer's size is based on the parent container's size (not the width and height attribute) so it's possible to style the parent container with css and even use it in fullscreen.
2021-04-02 18:52:00 +02:00
Viktor Kovacs
69b15ff559 Add separator parameter for parameter builder and parser. 2021-04-02 11:03:45 +02:00
Viktor Kovacs
cafb7171f9 Add parameter handling utilities. 2021-04-02 10:49:01 +02:00
Viktor Kovacs
8e7bebaf5f Rename urlutils to paramutils. 2021-04-02 10:38:53 +02:00
Viktor Kovacs
6d23481619 Use the camera recommended by the importer in case of no camera defined during embedding or self-hosting. 2021-04-02 10:05:47 +02:00
Viktor Kovacs
473da09052 Add function to reload the same model again. 2021-04-02 10:05:18 +02:00
Viktor Kovacs
b60305dd19 Possibility to set the default material color for importer in case of no-material surfaces. 2021-04-02 09:25:41 +02:00
Viktor Kovacs
30e4fdfcad Minor modification. 2021-04-01 15:39:09 +02:00
Viktor Kovacs
d8aa2feac3 Separate entities for url parameter handling. 2021-04-01 15:04:17 +02:00
Viktor Kovacs
c770b84e26 Replace tabs with spaces everywhere. 2021-03-31 18:02:14 +02:00
Viktor Kovacs
d1000c0c93 Add function to run a single task asynchronously. 2021-03-31 17:52:26 +02:00
Viktor Kovacs
e48c1b51e1 Pan with middle mouse #41 2021-03-31 16:20:50 +02:00
Viktor Kovacs
4acbf3046c Get rendered image as data url from the viewer. 2021-03-31 11:49:02 +02:00
Viktor Kovacs
0c03fb3bca Revoking urls is now the responsibility of the main importer object. 2021-03-31 08:14:35 +02:00
Viktor Kovacs
2450cb8feb Minor modification. 2021-03-31 07:47:37 +02:00
Viktor Kovacs
11d2f04580 Move buffer cache to the main importer class. 2021-03-30 19:22:38 +02:00
Viktor Kovacs
a9eb17269d Fix build. 2021-03-30 15:45:11 +02:00
Viktor Kovacs
90f8a07857 Revoke created object urls for export. 2021-03-30 15:44:30 +02:00
Viktor Kovacs
0c394f9aa8 Handle buffer cache by importers instead of the main importer object. 2021-03-30 12:21:46 +02:00
Viktor Kovacs
becbe31a9e Store object urls only for textures so they can safely revoked when the model is disposed. 2021-03-30 01:53:24 +02:00
Viktor Kovacs
3a02cb8f8e Revoke object urls from file list and model when they are no longer needed. 2021-03-30 00:45:43 +02:00
Viktor Kovacs
5d45d9eb57 Minor modification. 2021-03-29 15:25:37 +02:00
Viktor Kovacs
41d1d58eb9 Write utf-8 encoded json in binary gltf. 2021-03-29 15:23:09 +02:00
Viktor Kovacs
28347b9bd8 Do not pretty print json in case of binary gltf export. 2021-03-28 17:00:32 +02:00
Viktor Kovacs
fdb4b00fdc Create texture buffer view only if needed. 2021-03-28 16:45:47 +02:00
Viktor Kovacs
31aa3f24e4 Align main chunks to 4-byte boundary. 2021-03-28 16:39:44 +02:00
Viktor Kovacs
b4832a7cd0 Write position bounds to gltf file. 2021-03-28 16:30:02 +02:00
Viktor Kovacs
a35bceadea Write separate buffer view for all accessors. 2021-03-28 15:48:08 +02:00
Viktor Kovacs
e86486e314 Write all textures in the same buffer during gltf binary export. 2021-03-28 15:01:54 +02:00
Viktor Kovacs
4a3649e8f1 Remove callbacks from exporter. 2021-03-28 14:10:42 +02:00
Viktor Kovacs
c15e7ff3b4 Store the original file buffer in textures. 2021-03-28 14:06:55 +02:00
Viktor Kovacs
a1210d2129 Fix lgtm issues. 2021-03-28 09:59:51 +02:00
Viktor Kovacs
aefcd42084 Reorder function in importer base class. 2021-03-27 12:56:41 +01:00
Viktor Kovacs
9264c1dd6d Add code for new version. 2021-03-27 08:29:19 +01:00