mirror of
https://github.com/Astatin3/SiPEED-A075V.git
synced 2026-06-08 16:18:02 -06:00
Add point cloud
This commit is contained in:
Generated
+42
-328
@@ -20,13 +20,11 @@ dependencies = [
|
||||
"log",
|
||||
"ndarray",
|
||||
"once_cell",
|
||||
"pasture-core",
|
||||
"pasture-io",
|
||||
"ply-rs",
|
||||
"rand 0.9.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"typetag",
|
||||
"ureq",
|
||||
"wgpu 25.0.0",
|
||||
@@ -226,12 +224,6 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
|
||||
|
||||
[[package]]
|
||||
name = "android-tzdata"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
||||
|
||||
[[package]]
|
||||
name = "android_system_properties"
|
||||
version = "0.1.5"
|
||||
@@ -297,15 +289,6 @@ version = "1.0.98"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
||||
|
||||
[[package]]
|
||||
name = "approx"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arbitrary"
|
||||
version = "1.4.1"
|
||||
@@ -340,15 +323,9 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "array-init"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc"
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
version = "0.3.9"
|
||||
@@ -482,7 +459,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -517,7 +494,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -639,15 +616,6 @@ version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
version = "1.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bit-set"
|
||||
version = "0.8.0"
|
||||
@@ -669,12 +637,6 @@ version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
|
||||
|
||||
[[package]]
|
||||
name = "bitfield"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
@@ -768,7 +730,7 @@ checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -900,20 +862,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
|
||||
dependencies = [
|
||||
"android-tzdata",
|
||||
"iana-time-zone",
|
||||
"js-sys",
|
||||
"num-traits",
|
||||
"wasm-bindgen",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clipboard-win"
|
||||
version = "5.4.0"
|
||||
@@ -1164,7 +1112,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1393,7 +1341,7 @@ checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1404,7 +1352,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1580,12 +1528,6 @@ dependencies = [
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "float-ord"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e"
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
@@ -1616,7 +1558,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1667,7 +1609,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1980,30 +1922,6 @@ version = "1.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.63"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"core-foundation-sys",
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"log",
|
||||
"wasm-bindgen",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone-haiku"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_collections"
|
||||
version = "1.5.0"
|
||||
@@ -2119,7 +2037,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2209,7 +2127,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2227,15 +2145,6 @@ version = "1.70.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.12.1"
|
||||
@@ -2272,7 +2181,7 @@ checksum = "f3c30758ddd7188629c6713fc45d1188af4f44c90582311d0c8d8c9907f60c48"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2350,47 +2259,6 @@ version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
||||
|
||||
[[package]]
|
||||
name = "las"
|
||||
version = "0.8.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc1269d29c76146444ebfef86b78644e5507a5c7a98bc8fb4e60ddf255044ad7"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"chrono",
|
||||
"laz 0.9.3",
|
||||
"log",
|
||||
"num-traits",
|
||||
"thiserror 1.0.69",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "laz"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b25725927b0a5a0d86c12a18dac2c11ecb8caca47d37bc45b77a187d8f28dd21"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "laz"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e9be1582ff02cb56b08a4d273cc5f77eacd89d33a0c682ede9d0912e1c17773"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "lebe"
|
||||
version = "0.5.2"
|
||||
@@ -2530,15 +2398,6 @@ version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "memmap2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memmap2"
|
||||
version = "0.9.5"
|
||||
@@ -2635,35 +2494,6 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nalgebra"
|
||||
version = "0.32.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"bytemuck",
|
||||
"matrixmultiply",
|
||||
"nalgebra-macros",
|
||||
"num-complex",
|
||||
"num-rational",
|
||||
"num-traits",
|
||||
"serde",
|
||||
"simba",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nalgebra-macros"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndarray"
|
||||
version = "0.16.1"
|
||||
@@ -2776,7 +2606,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2787,7 +2616,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2838,7 +2667,7 @@ dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3208,66 +3037,6 @@ version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||
|
||||
[[package]]
|
||||
name = "pasture-core"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c02bd10ab8c2678e35e437a5375e72fb02c651bc55557b8cafe0203c3023ef70"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytemuck",
|
||||
"byteorder",
|
||||
"float-ord",
|
||||
"itertools 0.10.5",
|
||||
"lazy_static",
|
||||
"nalgebra",
|
||||
"num-traits",
|
||||
"pasture-derive",
|
||||
"rayon",
|
||||
"static_assertions",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pasture-derive"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a94e8b8d76fdd50f66d24bb27a16609672526b7cd32b70b96fabdfca3faffe8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pasture-io"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1549a18a77860548819d3614ed7838eab23a8632659f4e6451bc063f17fe4e5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"array-init",
|
||||
"bincode",
|
||||
"bitfield",
|
||||
"bytemuck",
|
||||
"byteorder",
|
||||
"chrono",
|
||||
"float-ord",
|
||||
"itertools 0.10.5",
|
||||
"las",
|
||||
"laz 0.8.3",
|
||||
"lazy_static",
|
||||
"memmap2 0.7.1",
|
||||
"nalgebra",
|
||||
"num-traits",
|
||||
"pasture-core",
|
||||
"pasture-derive",
|
||||
"scopeguard",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "peg"
|
||||
version = "0.6.3"
|
||||
@@ -3318,7 +3087,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3454,7 +3223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3596,7 +3365,7 @@ dependencies = [
|
||||
"built",
|
||||
"cfg-if 1.0.0",
|
||||
"interpolate_name",
|
||||
"itertools 0.12.1",
|
||||
"itertools",
|
||||
"libc",
|
||||
"libfuzzer-sys",
|
||||
"log",
|
||||
@@ -3862,15 +3631,6 @@ version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
|
||||
[[package]]
|
||||
name = "safe_arch"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
@@ -3900,7 +3660,7 @@ checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"log",
|
||||
"memmap2 0.9.5",
|
||||
"memmap2",
|
||||
"smithay-client-toolkit",
|
||||
"tiny-skia",
|
||||
]
|
||||
@@ -3931,7 +3691,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3954,7 +3714,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3992,19 +3752,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simba"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"num-complex",
|
||||
"num-traits",
|
||||
"paste",
|
||||
"wide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simd-adler32"
|
||||
version = "0.3.7"
|
||||
@@ -4072,7 +3819,7 @@ dependencies = [
|
||||
"cursor-icon",
|
||||
"libc",
|
||||
"log",
|
||||
"memmap2 0.9.5",
|
||||
"memmap2",
|
||||
"rustix 0.38.44",
|
||||
"thiserror 1.0.69",
|
||||
"wayland-backend",
|
||||
@@ -4151,7 +3898,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4160,17 +3907,6 @@ version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.101"
|
||||
@@ -4190,7 +3926,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4260,7 +3996,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4271,7 +4007,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4373,7 +4109,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4433,7 +4169,7 @@ checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4548,12 +4284,6 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
|
||||
|
||||
[[package]]
|
||||
name = "v_frame"
|
||||
version = "0.3.8"
|
||||
@@ -4624,7 +4354,7 @@ dependencies = [
|
||||
"log",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@@ -4659,7 +4389,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
@@ -5093,16 +4823,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wide"
|
||||
version = "0.7.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"safe_arch",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.2.8"
|
||||
@@ -5177,7 +4897,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5188,15 +4908,9 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
||||
|
||||
[[package]]
|
||||
name = "windows-result"
|
||||
version = "0.2.0"
|
||||
@@ -5442,7 +5156,7 @@ dependencies = [
|
||||
"dpi",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"memmap2 0.9.5",
|
||||
"memmap2",
|
||||
"ndk",
|
||||
"objc2 0.5.2",
|
||||
"objc2-app-kit 0.2.2",
|
||||
@@ -5596,7 +5310,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
@@ -5656,7 +5370,7 @@ checksum = "709ab20fc57cb22af85be7b360239563209258430bccf38d8b979c5a2ae3ecce"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"zbus-lockstep",
|
||||
"zbus_xml",
|
||||
"zvariant",
|
||||
@@ -5671,7 +5385,7 @@ dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
||||
@@ -5725,7 +5439,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5736,7 +5450,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5756,7 +5470,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
@@ -5785,7 +5499,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5834,7 +5548,7 @@ dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
||||
@@ -5846,5 +5560,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
"syn",
|
||||
]
|
||||
|
||||
@@ -33,5 +33,3 @@ env_logger = "0.11.8"
|
||||
ply-rs = "0.1.3"
|
||||
wgpu = "25.0.0"
|
||||
dialog = "0.3.0"
|
||||
pasture-core = "0.5.0"
|
||||
pasture-io = "0.5.0"
|
||||
|
||||
+2
-5
@@ -44,12 +44,9 @@ impl eframe::App for App {
|
||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
self.pane_manager.render(ui);
|
||||
// egui::scroll_area::ScrollArea::vertical().show(ui, |ui| {
|
||||
// egui::Frame::canvas(ui.style()).show(ui, |ui| {
|
||||
// self.custom_painting(ui.max_rect(), ui);
|
||||
// });
|
||||
// })
|
||||
});
|
||||
|
||||
ctx.request_repaint();
|
||||
}
|
||||
|
||||
// fn on_exit(&mut self, gl: Option<&glow::Context>) {
|
||||
|
||||
+81
-1
@@ -10,11 +10,12 @@ use std::{
|
||||
use std::io::Cursor;
|
||||
|
||||
use byteorder::{LittleEndian, ReadBytesExt};
|
||||
use egui::{Ui, mutex::Mutex};
|
||||
use egui::{Color32, Ui, mutex::Mutex};
|
||||
|
||||
use crate::{
|
||||
fetch_frame::{FrameMessage, ProcessedFrames, decode_frame, frame_config_encode, normalize},
|
||||
pane_manager::{Pane, PaneMode, PaneState, PsudoCreationContext},
|
||||
panes::point_cloud_renderer::LivePointView,
|
||||
};
|
||||
|
||||
// Constants (replace with your actual values)
|
||||
@@ -27,6 +28,8 @@ pub struct CameraPane {
|
||||
frames: Arc<Mutex<ProcessedFrames>>,
|
||||
#[serde(skip)]
|
||||
thread_handle: Option<thread::JoinHandle<()>>,
|
||||
#[serde(skip)]
|
||||
point_cloud: LivePointView,
|
||||
}
|
||||
|
||||
impl Default for CameraPane {
|
||||
@@ -52,6 +55,7 @@ impl Default for CameraPane {
|
||||
Self {
|
||||
frames,
|
||||
thread_handle: Some(decoder_handle),
|
||||
point_cloud: LivePointView::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +72,7 @@ impl Pane for CameraPane {
|
||||
}
|
||||
|
||||
fn init(&mut self, pcc: &PsudoCreationContext) {
|
||||
self.point_cloud.init(pcc);
|
||||
// decoder_thread(rx, tx);
|
||||
|
||||
// let mut frames_lock = self.frames.lock();
|
||||
@@ -123,11 +128,86 @@ impl Pane for CameraPane {
|
||||
if !processed {
|
||||
ui.heading("Waiting for frames...");
|
||||
}
|
||||
|
||||
if let Some(ref status) = frames.status {
|
||||
if let Some(ref depth) = frames.depth {
|
||||
if let Some(ref rgb) = frames.rgb {
|
||||
let mut points: Vec<(i32, i32, i32, Color32)> = Vec::new();
|
||||
|
||||
for i in 0..(320 * 240) {
|
||||
let x = i / 240;
|
||||
let y = i % 320;
|
||||
|
||||
// println!("{:?}", status.get((x, y)));
|
||||
|
||||
let status = status.get((x, y));
|
||||
|
||||
if status.is_none() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let status = *status.unwrap();
|
||||
|
||||
if status != 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if *status.get((x, y)).unwrap() != 0u16 {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
|
||||
let (r, g, b) = if let Some((rgbx, rgby)) = scale_shift_rgb_xy(x, y) {
|
||||
(
|
||||
*rgb.get((rgbx, rgby, 0)).unwrap() as u8,
|
||||
*rgb.get((rgbx, rgby, 1)).unwrap() as u8,
|
||||
*rgb.get((rgbx, rgby, 2)).unwrap() as u8,
|
||||
)
|
||||
} else {
|
||||
(255, 255, 255)
|
||||
};
|
||||
|
||||
let d = *depth.get((x, y)).unwrap();
|
||||
|
||||
points.push((
|
||||
(y as i32) * 5,
|
||||
(x as i32) * 5,
|
||||
d as i32,
|
||||
Color32::from_rgb(r, g, b),
|
||||
))
|
||||
}
|
||||
|
||||
self.point_cloud.set_points(points);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.point_cloud.render(ui);
|
||||
}
|
||||
|
||||
fn context_menu(&mut self, ui: &mut Ui) {}
|
||||
}
|
||||
|
||||
fn scale_shift_rgb_xy(x: usize, y: usize) -> Option<(usize, usize)> {
|
||||
static X_OFFSET: f32 = -10.;
|
||||
static Y_OFFSET: f32 = -10.;
|
||||
static SCAME: f32 = 1.9;
|
||||
|
||||
let x = ((x as f32 + X_OFFSET) * SCAME) as usize;
|
||||
let y = ((y as f32 + Y_OFFSET) * SCAME) as usize;
|
||||
|
||||
if x < 0 || y >= 640 {
|
||||
return None;
|
||||
}
|
||||
if y < 0 || x >= 480 {
|
||||
return None;
|
||||
}
|
||||
|
||||
// println!("{}, {}", x, y);
|
||||
|
||||
Some((x as usize, y as usize))
|
||||
}
|
||||
|
||||
fn fetch_frame() -> Result<Vec<u8>, Box<dyn std::error::Error>> {
|
||||
is_success(&frame_config_encode(1, 0, 255, 0, 2, 7, 1, 0, 0))?;
|
||||
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
use std::{
|
||||
error::Error,
|
||||
sync::{Arc, Mutex},
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use eframe::egui_glow;
|
||||
use egui::{Align2, Color32, FontId, InputState, Stroke, Ui};
|
||||
use glam::Vec3;
|
||||
use wgpu::Color;
|
||||
|
||||
use crate::pane_manager::PsudoCreationContext;
|
||||
|
||||
use super::renderer::{self, Camera, PointRenderer};
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
pub struct LivePointView {
|
||||
#[serde(skip)]
|
||||
renderer: Arc<Mutex<PointRenderer>>,
|
||||
#[serde(skip)]
|
||||
points: Vec<(i32, i32, i32, Color32)>,
|
||||
}
|
||||
|
||||
impl Default for LivePointView {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
renderer: Arc::new(Mutex::new(PointRenderer::default())),
|
||||
points: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl LivePointView {
|
||||
pub fn init(&mut self, pcc: &PsudoCreationContext) {
|
||||
let renderer = self.renderer.lock();
|
||||
if renderer.is_ok() {
|
||||
renderer
|
||||
.unwrap()
|
||||
.init(pcc.gl.clone(), 100_000)
|
||||
.expect("Failed to init renderer!");
|
||||
} else {
|
||||
error!("Live point view - Failed to initilize renderer!");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render(&mut self, ui: &mut Ui) {
|
||||
egui::Window::new("Live point view").show(ui.ctx(), |ui| {
|
||||
let max_rect = ui.max_rect();
|
||||
|
||||
let renderer = self.renderer.clone();
|
||||
if renderer.lock().is_err() {
|
||||
error!("Live point view - Failed to lock renderer!");
|
||||
return;
|
||||
}
|
||||
if renderer.lock().unwrap().gl.is_none() {
|
||||
error!("Live point view - Failed to aquire opengl!");
|
||||
return;
|
||||
}
|
||||
renderer.lock().unwrap().clear();
|
||||
|
||||
let start_time = Instant::now();
|
||||
|
||||
let (rect, response) = ui.allocate_exact_size(
|
||||
egui::Vec2 {
|
||||
x: max_rect.width(),
|
||||
y: max_rect.height(),
|
||||
},
|
||||
egui::Sense::drag(),
|
||||
);
|
||||
|
||||
let input_state: Option<InputState> = ui.input(|input_state| {
|
||||
if response.hovered() {
|
||||
//&& response.has_focus() {
|
||||
Some(input_state.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
|
||||
for &(x, y, z, color) in &self.points {
|
||||
renderer.lock().unwrap().add_point(x, y, z, color);
|
||||
}
|
||||
|
||||
let o = <std::option::Option<Camera> as Clone>::clone(&renderer.lock().unwrap().camera)
|
||||
.unwrap()
|
||||
.orientation
|
||||
.clone();
|
||||
|
||||
let cb = egui_glow::CallbackFn::new(move |_info, _painter| {
|
||||
renderer
|
||||
.lock()
|
||||
.unwrap()
|
||||
.render(max_rect, input_state.clone());
|
||||
});
|
||||
|
||||
let callback = egui::PaintCallback {
|
||||
rect: max_rect,
|
||||
callback: Arc::new(cb),
|
||||
};
|
||||
|
||||
ui.painter().add(callback);
|
||||
let line_length: f32 = 20.;
|
||||
|
||||
// if let Some(input_state) = input_state {
|
||||
// if input_state.pointer.any_down() {
|
||||
|
||||
let drawline = |pos: Vec3, color: Color32| {
|
||||
ui.painter().line_segment(
|
||||
[
|
||||
rect.center(),
|
||||
rect.center()
|
||||
+ egui::Vec2 {
|
||||
x: line_length * pos.x,
|
||||
y: -line_length * pos.y,
|
||||
},
|
||||
],
|
||||
Stroke { width: 1.5, color },
|
||||
);
|
||||
};
|
||||
|
||||
drawline(o.inverse() * glam::Vec3::X, Color32::RED);
|
||||
drawline(o.inverse() * glam::Vec3::Y, Color32::BLUE);
|
||||
drawline(o.inverse() * glam::Vec3::Z, Color32::GREEN);
|
||||
|
||||
let text_size = 12.;
|
||||
|
||||
ui.painter().text(
|
||||
max_rect.min,
|
||||
Align2::LEFT_TOP,
|
||||
format!("{} ms", start_time.elapsed().as_millis()),
|
||||
FontId::monospace(text_size),
|
||||
Color32::WHITE,
|
||||
);
|
||||
|
||||
ui.painter().text(
|
||||
max_rect.min
|
||||
+ egui::Vec2 {
|
||||
x: 0.,
|
||||
y: text_size,
|
||||
},
|
||||
Align2::LEFT_TOP,
|
||||
format!("{} points", self.points.len()),
|
||||
FontId::monospace(text_size),
|
||||
Color32::WHITE,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_points(&mut self, points: Vec<(i32, i32, i32, Color32)>) {
|
||||
self.points = points;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
mod liveview;
|
||||
mod pane;
|
||||
mod renderer;
|
||||
|
||||
pub use liveview::LivePointView;
|
||||
pub use pane::PointRendererPane;
|
||||
|
||||
@@ -39,7 +39,7 @@ impl Pane for PointRendererPane {
|
||||
}
|
||||
}
|
||||
fn init(&mut self, pcc: &PsudoCreationContext) {
|
||||
self.renderer.lock().init(pcc.gl.clone(), 1_000_000);
|
||||
self.renderer.lock().init(pcc.gl.clone(), 100_000);
|
||||
}
|
||||
fn name(&mut self) -> &str {
|
||||
"Point Cloud"
|
||||
@@ -101,7 +101,7 @@ impl Pane for PointRendererPane {
|
||||
|
||||
if self.points.is_empty() {
|
||||
let radius = 1000i32;
|
||||
for i in 0..100000 {
|
||||
for i in 0..100_000 {
|
||||
// let theta = (i as f32 * 0.1).sin() * std::f32::consts::PI;
|
||||
// let phi = (i as f32 * 0.1).cos() * std::f32::consts::PI;
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@ use eframe::egui_glow;
|
||||
use egui::{Color32, InputState, Rect};
|
||||
use egui_glow::glow;
|
||||
use glam::{Mat4, Quat, Vec3};
|
||||
use pasture_core::containers::{
|
||||
BorrowedBuffer, BorrowedBufferExt, InterleavedBufferMut, VectorBuffer,
|
||||
};
|
||||
use pasture_core::layout::attributes::{COLOR_RGB, POSITION_3D};
|
||||
use pasture_core::nalgebra::Vector3;
|
||||
use pasture_io::base::read_all;
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::sync::Arc;
|
||||
@@ -471,60 +465,33 @@ impl PointRenderer {
|
||||
.title("File Selection")
|
||||
// .path("/home/user/Downloads")
|
||||
.show()
|
||||
.expect("Could not display dialog box");
|
||||
|
||||
let mut points = read_all::<VectorBuffer, _>("pointcloud.las")?;
|
||||
|
||||
let loaded_points: Vec<(i32, i32, i32, Color32)> = Vec::with_capacity(points.len());
|
||||
|
||||
let has_pos = points.point_layout().has_attribute(&POSITION_3D);
|
||||
let has_color = points.point_layout().has_attribute(&COLOR_RGB);
|
||||
|
||||
if has_pos {
|
||||
for position in points
|
||||
.view_attribute::<Vector3<f64>>(&POSITION_3D)
|
||||
.into_iter()
|
||||
.take(10)
|
||||
{
|
||||
info!("({};{};{})", position.x, position.y, position.z);
|
||||
}
|
||||
}
|
||||
|
||||
if has_color {
|
||||
for i in 0..points.len() {
|
||||
let point = points.get_point_mut(i);
|
||||
|
||||
warn!("{:?}", point);
|
||||
|
||||
// println!("({};{};{})", color.x, position.y, position.z);
|
||||
}
|
||||
}
|
||||
|
||||
Err("".into())
|
||||
.expect("Could not display dialog box")
|
||||
.expect("Could not select file");
|
||||
|
||||
// let file = File::open(path).map_err(|e| format!("Failed to open file: {}", e))?;
|
||||
// let reader = BufReader::new(file);
|
||||
// let mut lines = reader.lines();
|
||||
let file = File::open(choice)?;
|
||||
let reader = BufReader::new(file);
|
||||
let mut lines = reader.lines();
|
||||
|
||||
// // Parse header
|
||||
// let header = Self::parse_ply_header(&mut lines)?;
|
||||
// Parse header
|
||||
let header = Self::parse_ply_header(&mut lines)?;
|
||||
|
||||
// // Clear existing points
|
||||
// self.clear();
|
||||
// Clear existing points
|
||||
self.clear();
|
||||
|
||||
// // Reserve capacity
|
||||
// self.points
|
||||
// .as_mut()
|
||||
// .as_mut()
|
||||
// .expect("Not Initialised")
|
||||
// .reserve(header.vertex_count * 7);
|
||||
// Reserve capacity
|
||||
self.points
|
||||
.as_mut()
|
||||
.as_mut()
|
||||
.expect("Not Initialised")
|
||||
.reserve(header.vertex_count * 7);
|
||||
|
||||
// // Parse vertices based on format
|
||||
// if header.is_binary {
|
||||
// return Err("Binary PLY files not yet supported".to_string());
|
||||
// } else {
|
||||
// self.parse_ascii_ply_data(lines, header)
|
||||
// }
|
||||
// Parse vertices based on format
|
||||
if header.is_binary {
|
||||
return Err("Binary PLY files not yet supported".into());
|
||||
} else {
|
||||
self.parse_ascii_ply_data(lines, header)
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_ply_header<B: BufRead>(lines: &mut std::io::Lines<B>) -> Result<PlyHeader, String> {
|
||||
@@ -569,54 +536,54 @@ impl PointRenderer {
|
||||
})
|
||||
}
|
||||
|
||||
// fn parse_ascii_ply_data<B: BufRead>(
|
||||
// &mut self,
|
||||
// lines: std::io::Lines<B>,
|
||||
// header: PlyHeader,
|
||||
// ) -> Result<Vec<(i32, i32, i32, Color32)>, String> {
|
||||
// let mut vec: Vec<(i32, i32, i32, Color32)> = Vec::new();
|
||||
fn parse_ascii_ply_data<B: BufRead>(
|
||||
&mut self,
|
||||
lines: std::io::Lines<B>,
|
||||
header: PlyHeader,
|
||||
) -> Result<Vec<(i32, i32, i32, Color32)>, Box<dyn std::error::Error>> {
|
||||
let mut vec: Vec<(i32, i32, i32, Color32)> = Vec::new();
|
||||
|
||||
// for line in lines.take(header.vertex_count) {
|
||||
// let line = line.map_err(|e| format!("Failed to read line: {}", e))?;
|
||||
// let parts: Vec<&str> = line.split_whitespace().collect();
|
||||
for line in lines.take(header.vertex_count) {
|
||||
let line = line.map_err(|e| format!("Failed to read line: {}", e))?;
|
||||
let parts: Vec<&str> = line.split_whitespace().collect();
|
||||
|
||||
// if parts.len() < 3 {
|
||||
// return Err("Invalid vertex data".to_string());
|
||||
// }
|
||||
if parts.len() < 3 {
|
||||
return Err("Invalid vertex data".into());
|
||||
}
|
||||
|
||||
// // Parse position
|
||||
// let x = parts[0]
|
||||
// .parse::<f32>()
|
||||
// .map_err(|_| "Invalid X coordinate")?;
|
||||
// let y = parts[1]
|
||||
// .parse::<f32>()
|
||||
// .map_err(|_| "Invalid Y coordinate")?;
|
||||
// let z = parts[2]
|
||||
// .parse::<f32>()
|
||||
// .map_err(|_| "Invalid Z coordinate")?;
|
||||
// Parse position
|
||||
let x = parts[0]
|
||||
.parse::<f32>()
|
||||
.map_err(|_| "Invalid X coordinate")?;
|
||||
let y = parts[1]
|
||||
.parse::<f32>()
|
||||
.map_err(|_| "Invalid Y coordinate")?;
|
||||
let z = parts[2]
|
||||
.parse::<f32>()
|
||||
.map_err(|_| "Invalid Z coordinate")?;
|
||||
|
||||
// // Convert to fixed point (scale by 1000 for better precision)
|
||||
// let x = (x * 1000.0) as i32;
|
||||
// let y = (y * 1000.0) as i32;
|
||||
// let z = (z * 1000.0) as i32;
|
||||
// Convert to fixed point (scale by 1000 for better precision)
|
||||
let x = (x * 1000.0) as i32;
|
||||
let y = (y * 1000.0) as i32;
|
||||
let z = (z * 1000.0) as i32;
|
||||
|
||||
// // Parse colors if present
|
||||
// let color = if header.has_colors && parts.len() >= 6 {
|
||||
// let r = parts[3].parse::<u8>().unwrap_or(255);
|
||||
// let g = parts[4].parse::<u8>().unwrap_or(255);
|
||||
// let b = parts[5].parse::<u8>().unwrap_or(255);
|
||||
// Color32::from_rgb(r, g, b)
|
||||
// } else {
|
||||
// Color32::WHITE
|
||||
// };
|
||||
// Parse colors if present
|
||||
let color = if header.has_colors && parts.len() >= 6 {
|
||||
let r = parts[3].parse::<u8>().unwrap_or(255);
|
||||
let g = parts[4].parse::<u8>().unwrap_or(255);
|
||||
let b = parts[5].parse::<u8>().unwrap_or(255);
|
||||
Color32::from_rgb(r, g, b)
|
||||
} else {
|
||||
Color32::WHITE
|
||||
};
|
||||
|
||||
// vec.push((x, y, z, color));
|
||||
vec.push((x, y, z, color));
|
||||
|
||||
// // self.add_point(x, y, z, color);
|
||||
// }
|
||||
// self.add_point(x, y, z, color);
|
||||
}
|
||||
|
||||
// Ok(vec)
|
||||
// }
|
||||
Ok(vec)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for PointRenderer {
|
||||
|
||||
Reference in New Issue
Block a user