From 58d130346812fdb590b2a01d71845d9db3bea424 Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Wed, 29 Nov 2023 13:24:09 +1100 Subject: [PATCH] fix ply and stl exports (#1141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix ply and stl exports * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * explanation comment --------- Co-authored-by: github-actions[bot] --- e2e/playwright/export-snapshots/ply-ascii.ply | 282 +++++++++++ .../ply-binary_big_endian.ply | Bin 0 -> 3535 bytes .../ply-binary_little_endian.ply | Bin 0 -> 3538 bytes e2e/playwright/export-snapshots/stl-ascii.stl | 478 ++++++++++++++++++ .../export-snapshots/stl-binary.stl | Bin 0 -> 3484 bytes e2e/playwright/snapshot-tests.spec.ts | 62 ++- package.json | 2 +- src/components/ExportButton.tsx | 13 +- yarn.lock | 8 +- 9 files changed, 813 insertions(+), 32 deletions(-) create mode 100644 e2e/playwright/export-snapshots/ply-ascii.ply create mode 100644 e2e/playwright/export-snapshots/ply-binary_big_endian.ply create mode 100644 e2e/playwright/export-snapshots/ply-binary_little_endian.ply create mode 100644 e2e/playwright/export-snapshots/stl-ascii.stl create mode 100644 e2e/playwright/export-snapshots/stl-binary.stl diff --git a/e2e/playwright/export-snapshots/ply-ascii.ply b/e2e/playwright/export-snapshots/ply-ascii.ply new file mode 100644 index 0000000000..7eda8ff5f1 --- /dev/null +++ b/e2e/playwright/export-snapshots/ply-ascii.ply @@ -0,0 +1,282 @@ +ply +format ascii 1.0 +comment Generated by kittycad.io +element vertex 204 +property float x +property float y +property float z +element face 68 +property list uchar uint vertex_indices +end_header +0 0 4 +0 0 0 +0 -1 4 +0 -1 4 +0 0 0 +0 -1 0 +0 -1 4 +0 -1 0 +3.0950184 -1 4 +3.0950184 -1 4 +0 -1 0 +3.0950184 -1 0 +3.0950184 -1 4 +3.0950184 -1 0 +5.9513144 -3 4 +5.9513144 -3 4 +3.0950184 -1 0 +5.9513144 -3 0 +5.9513144 -3 4 +5.9513144 -3 0 +9.5 -3 4 +9.5 -3 4 +5.9513144 -3 0 +9.5 -3 0 +9.5 -3 4 +9.5 -3 0 +9.5 -2.5 4 +9.5 -2.5 4 +9.5 -3 0 +9.5 -2.5 0 +9.5 -2.5 4 +9.5 -2.5 0 +6.108964 -2.5 4 +6.108964 -2.5 4 +9.5 -2.5 0 +6.108964 -2.5 0 +3.4311862 -0.625 4 +4.323779 -1.25 4 +4.323779 -1.25 0 +4.323779 -1.25 4 +6.108964 -2.5 4 +6.108964 -2.5 0 +3.4311862 -0.625 0 +2.5385938 0 0 +2.5385938 0 4 +3.4311862 -0.625 4 +3.4311862 -0.625 0 +2.5385938 0 4 +4.323779 -1.25 4 +6.108964 -2.5 0 +4.323779 -1.25 0 +3.4311862 -0.625 0 +3.4311862 -0.625 4 +4.323779 -1.25 0 +3.342784 0.375 4 +2.5385938 0 4 +2.5385938 0 0 +4.146974 0.75 4 +3.342784 0.375 4 +3.342784 0.375 0 +3.342784 0.375 0 +4.146974 0.75 0 +4.146974 0.75 4 +4.146974 0.75 0 +5.755354 1.5 0 +5.755354 1.5 4 +3.342784 0.375 4 +2.5385938 0 0 +3.342784 0.375 0 +5.755354 1.5 4 +4.146974 0.75 4 +4.146974 0.75 0 +5.755354 1.5 4 +5.755354 1.5 0 +9.5 1.5 4 +9.5 1.5 4 +5.755354 1.5 0 +9.5 1.5 0 +9.5 1.5 4 +9.5 1.5 0 +9.5 2 4 +9.5 2 4 +9.5 1.5 0 +9.5 2 0 +9.5 2 4 +9.5 2 0 +5.644507 2 4 +5.644507 2 4 +9.5 2 0 +5.644507 2 0 +5.644507 2 4 +5.644507 2 0 +3.5 1 4 +3.5 1 4 +5.644507 2 0 +3.5 1 0 +3.5 1 4 +3.5 1 0 +0 1 4 +0 1 4 +3.5 1 0 +0 1 0 +0 1 4 +0 1 0 +0 0 4 +0 0 4 +0 1 0 +0 0 0 +3.342784 0.375 0 +2.5385938 0 0 +3.5 1 0 +3.4311862 -0.625 0 +4.323779 -1.25 0 +3.0950184 -1 0 +3.342784 0.375 0 +3.5 1 0 +4.146974 0.75 0 +4.323779 -1.25 0 +5.9513144 -3 0 +3.0950184 -1 0 +0 -1 0 +2.5385938 0 0 +3.0950184 -1 0 +0 -1 0 +0 0 0 +2.5385938 0 0 +9.5 -3 0 +6.108964 -2.5 0 +9.5 -2.5 0 +9.5 -3 0 +5.9513144 -3 0 +6.108964 -2.5 0 +5.9513144 -3 0 +4.323779 -1.25 0 +6.108964 -2.5 0 +5.644507 2 0 +5.755354 1.5 0 +4.146974 0.75 0 +3.0950184 -1 0 +2.5385938 0 0 +3.4311862 -0.625 0 +4.146974 0.75 0 +3.5 1 0 +5.644507 2 0 +9.5 1.5 0 +5.755354 1.5 0 +9.5 2 0 +5.755354 1.5 0 +5.644507 2 0 +9.5 2 0 +2.5385938 0 0 +0 0 0 +0 1 0 +3.5 1 0 +2.5385938 0 0 +0 1 0 +3.342784 0.375 4 +3.5 1 4 +2.5385938 0 4 +4.146974 0.75 4 +3.5 1 4 +3.342784 0.375 4 +3.4311862 -0.625 4 +3.0950184 -1 4 +4.323779 -1.25 4 +4.146974 0.75 4 +5.755354 1.5 4 +5.644507 2 4 +0 1 4 +2.5385938 0 4 +3.5 1 4 +0 1 4 +0 0 4 +2.5385938 0 4 +5.644507 2 4 +5.755354 1.5 4 +9.5 2 4 +9.5 2 4 +5.755354 1.5 4 +9.5 1.5 4 +4.146974 0.75 4 +5.644507 2 4 +3.5 1 4 +2.5385938 0 4 +3.0950184 -1 4 +3.4311862 -0.625 4 +4.323779 -1.25 4 +3.0950184 -1 4 +5.9513144 -3 4 +6.108964 -2.5 4 +4.323779 -1.25 4 +5.9513144 -3 4 +9.5 -2.5 4 +6.108964 -2.5 4 +9.5 -3 4 +6.108964 -2.5 4 +5.9513144 -3 4 +9.5 -3 4 +2.5385938 0 4 +0 -1 4 +3.0950184 -1 4 +0 -1 4 +2.5385938 0 4 +0 0 4 +3 0 1 2 +3 3 4 5 +3 6 7 8 +3 9 10 11 +3 12 13 14 +3 15 16 17 +3 18 19 20 +3 21 22 23 +3 24 25 26 +3 27 28 29 +3 30 31 32 +3 33 34 35 +3 36 37 38 +3 39 40 41 +3 42 43 44 +3 45 46 47 +3 48 49 50 +3 51 52 53 +3 54 55 56 +3 57 58 59 +3 60 61 62 +3 63 64 65 +3 66 67 68 +3 69 70 71 +3 72 73 74 +3 75 76 77 +3 78 79 80 +3 81 82 83 +3 84 85 86 +3 87 88 89 +3 90 91 92 +3 93 94 95 +3 96 97 98 +3 99 100 101 +3 102 103 104 +3 105 106 107 +3 108 109 110 +3 111 112 113 +3 114 115 116 +3 117 118 119 +3 120 121 122 +3 123 124 125 +3 126 127 128 +3 129 130 131 +3 132 133 134 +3 135 136 137 +3 138 139 140 +3 141 142 143 +3 144 145 146 +3 147 148 149 +3 150 151 152 +3 153 154 155 +3 156 157 158 +3 159 160 161 +3 162 163 164 +3 165 166 167 +3 168 169 170 +3 171 172 173 +3 174 175 176 +3 177 178 179 +3 180 181 182 +3 183 184 185 +3 186 187 188 +3 189 190 191 +3 192 193 194 +3 195 196 197 +3 198 199 200 +3 201 202 203 diff --git a/e2e/playwright/export-snapshots/ply-binary_big_endian.ply b/e2e/playwright/export-snapshots/ply-binary_big_endian.ply new file mode 100644 index 0000000000000000000000000000000000000000..ad4b6e11a02bd53d0bb716a9010947e7f5ccbce9 GIT binary patch literal 3535 zcmai$2b+^c6osQ$V^{3$6T6G+f{57IK@sd78|WsRd|@NmWXWc6gQ!ulp<-98Aoku? z#YR@Kpg#Tse}q55b0%|>lWcgL=Xp2x+?=^{zsY1aBZX=*S1J#uE74%Sm@Zcb2J_1Y z;$k+RE=IF@`;wW`@NitLM2q8MTuxWwY&2MnR^%&{Y9^iS&6kpKA@+tS$!s=+;&9ftaGaohj@pUwIbcD4cA2!xS%zn(zcigr$n3kNAq3kYaJiY7{89M94^Fu-*l}IPw{kF%X_pRovSs~v*h2I z^C!czXb;-k+KFlXE_l=*V!y7&!SC}rSMytX{^`fM-V{?%Y(E95CpZdP0ti{il z>)Ls+*md!+w{CvRI|NooV|y;nWuC)g^)v4#HvaAST5FHZkGGm0jn(h-DLhv#)X_N9 zSC7WNPVh6&VRbZisYaeT4ti{K`Yq2_*0*7?&TYP@pRa!Isn%Lf&$FIky^FMt&egN0 zbHkm+KJ?zBuGjb%dF@Bm;(O*{Y(xG09C`0?*geD8=OacTc0O#oGu5y6WZRt+?itRu zv*cqr&rY9R`qw_&_E!BV*?&1p?BC9L=Xb}k0SwJ+Z*6B=_O>yr_1Dgco;~fE&ZbB2 zjZ`D=&vvNqW4$ZXqjUA1414A0hBGszj^0J`UAEq)^dRf1hcU+#ztpt-q{sHKGw$>> z?>BvRt(n@vUg@*zp6EWPM}HgW|33AL$IichUh(_93;Q5>JOB2)_FKZv1M?jGKKh!{ zTU%bv1M?j8FZ59&u@hc*rkDnH0lQM{26hK~Q0xi#`)x0Zy}>?UUyA*}{@?(L1HnOH zI>o`@5O633zB-A+!4VWkf}_CE6vu#LK}2yJm;sKbI02jpPNFy&oB~dzI1TiGnG~mk zUT_9QAD9JZQ=AFrfU_v(g0sOqigUoZ;5>@+!3AJGML%$00mX&jBCwF+Vz3A-rnm%L z3NE9#99#jeq__%P4X&ZM7V!7Z^%OUNCE!Mio50QB7K&TJQm~BTHgG!_ph$r<7^KL6 zEQl#`U^y6~$b&n;3W@?421SYz7y&CO%3u^!D8|4la3{q$sDjlLcY!tFZi;)ry`V;M zAGjYpK(Q7)2p*z%7(4jDV_pPgJ&q71AIn@CEpiVgh^x vzNYvFYysa=d5ap@ZP_Zi(ir9Nw z6&oAHg8KOn{1N^H&&e>EGa>uF@0`8o?wLFH&6_tb!{tV%Sgj4^>d`={lB+ecPaCQXhch4Yvgl<-cmJ_l#`ZWc~Yw z*_q*5br`A<70XrB9_vgrIuk3}Rf@TM63ve*4sUvGt^}#&$%f#~Aha*qEMWTTv%& zvLB7RdnWU9)@hfxIvV?$>d~0%;KsUq)U@lvyvFR4m&d+{B} zUAKt-)^jN?UW0g3M{JDd{n#}2vDPtW!Ps=vv6qk2Sm*Mw`qQ}kT-rl8m#?E^jhXS^ zLiEtQi0i36_}G{!-K|ENhHBMvA8?yv;(jE8Z zf<;n6sat>Rd{T%I`>cY4D8qtD&<8SZDl|Mlz&>*!eBdpcIn zA3f9T9oTbH`#x!Ljl((m@UzJt1NLyz{r|Ad#@C%%WB{nq2p2ktTF56?8e4xvZK`gI7un|{sp zoJnK9&iX#GJ}>qb_Mp9~$HuKO!8z>LJe;l1mc=sNhl z6#h2wds4qOp~v>j{jc9gcQ1Tj!o1)Ap+|e>>S5dj$7*ky-`U?96ZiAaF2Jrp{}j+} z!0r@#fc6CTqSzb6A8-3m>+(L0H=r-VXiaS7yfW;Jdg6;yc6iYxkV1ObIDgX&Z5p*{& zNKpda11zN|gNA?#MHMs*ETgD_Mu0lSC}=rwFU1(B0j!|753~}vpW*?~Dj=nJ5cCl6 zFvV)nBfz5+kAWTso}gF*dJ=ew;%U%Y;2DZ%LC*otQ@j9r5qOE>WzZ|YI*M08uK}-9 zya8GdY@pZ(+625wu^IFh@HWLepm%}yDBcHs0DMUC5$I#!6N*nkp8=m!d;$6r_=;j2 z^fmAe#kZg>z;_higMI*hr1%N66_}uCf_?^mq1Xoc75I(fchDcec8Whie*u33{{w!~ BdT;;$ literal 0 HcmV?d00001 diff --git a/e2e/playwright/export-snapshots/stl-ascii.stl b/e2e/playwright/export-snapshots/stl-ascii.stl new file mode 100644 index 0000000000..de9e5ca778 --- /dev/null +++ b/e2e/playwright/export-snapshots/stl-ascii.stl @@ -0,0 +1,478 @@ +solid unnamed +facet normal -1 0 0 + outer loop + vertex 0 -4 0 + vertex 0 -0 0 + vertex 0 -4 -1 + endloop +endfacet +facet normal -1 0 0 + outer loop + vertex 0 -4 -1 + vertex 0 -0 0 + vertex 0 -0 -1 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 0 -4 -1 + vertex 0 -0 -1 + vertex 3.0950184 -4 -1 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 3.0950184 -4 -1 + vertex 0 -0 -1 + vertex 3.0950184 -0 -1 + endloop +endfacet +facet normal -0.57357645 0 -0.81915206 + outer loop + vertex 3.0950184 -4 -1 + vertex 3.0950184 -0 -1 + vertex 5.9513144 -4 -3 + endloop +endfacet +facet normal -0.57357645 0 -0.81915206 + outer loop + vertex 5.9513144 -4 -3 + vertex 3.0950184 -0 -1 + vertex 5.9513144 -0 -3 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 5.9513144 -4 -3 + vertex 5.9513144 -0 -3 + vertex 9.5 -4 -3 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 9.5 -4 -3 + vertex 5.9513144 -0 -3 + vertex 9.5 -0 -3 + endloop +endfacet +facet normal 1 0 0 + outer loop + vertex 9.5 -4 -3 + vertex 9.5 -0 -3 + vertex 9.5 -4 -2.5 + endloop +endfacet +facet normal 1 -0 0 + outer loop + vertex 9.5 -4 -2.5 + vertex 9.5 -0 -3 + vertex 9.5 -0 -2.5 + endloop +endfacet +facet normal 0 -0 0.99999994 + outer loop + vertex 9.5 -4 -2.5 + vertex 9.5 -0 -2.5 + vertex 6.108964 -4 -2.5 + endloop +endfacet +facet normal 0 0 0.99999994 + outer loop + vertex 6.108964 -4 -2.5 + vertex 9.5 -0 -2.5 + vertex 6.108964 -0 -2.5 + endloop +endfacet +facet normal 0.5735763 0 0.8191522 + outer loop + vertex 3.4311862 -4 -0.625 + vertex 4.323779 -4 -1.25 + vertex 4.323779 -0 -1.25 + endloop +endfacet +facet normal 0.57357645 0 0.819152 + outer loop + vertex 4.323779 -4 -1.25 + vertex 6.108964 -4 -2.5 + vertex 6.108964 -0 -2.5 + endloop +endfacet +facet normal 0.57357645 0 0.819152 + outer loop + vertex 3.4311862 -0 -0.625 + vertex 2.5385938 -0 0 + vertex 2.5385938 -4 0 + endloop +endfacet +facet normal 0.57357645 -0 0.819152 + outer loop + vertex 3.4311862 -4 -0.625 + vertex 3.4311862 -0 -0.625 + vertex 2.5385938 -4 0 + endloop +endfacet +facet normal 0.57357645 -0 0.819152 + outer loop + vertex 4.323779 -4 -1.25 + vertex 6.108964 -0 -2.5 + vertex 4.323779 -0 -1.25 + endloop +endfacet +facet normal 0.5735763 0 0.8191522 + outer loop + vertex 3.4311862 -0 -0.625 + vertex 3.4311862 -4 -0.625 + vertex 4.323779 -0 -1.25 + endloop +endfacet +facet normal 0.42261824 0 -0.9063078 + outer loop + vertex 3.342784 -4 0.375 + vertex 2.5385938 -4 0 + vertex 2.5385938 -0 0 + endloop +endfacet +facet normal 0.42261824 0 -0.9063078 + outer loop + vertex 4.146974 -4 0.75 + vertex 3.342784 -4 0.375 + vertex 3.342784 -0 0.375 + endloop +endfacet +facet normal 0.42261824 0 -0.9063078 + outer loop + vertex 3.342784 -0 0.375 + vertex 4.146974 -0 0.75 + vertex 4.146974 -4 0.75 + endloop +endfacet +facet normal 0.42261833 0 -0.90630776 + outer loop + vertex 4.146974 -0 0.75 + vertex 5.755354 -0 1.5 + vertex 5.755354 -4 1.5 + endloop +endfacet +facet normal 0.42261824 0 -0.9063078 + outer loop + vertex 3.342784 -4 0.375 + vertex 2.5385938 -0 0 + vertex 3.342784 -0 0.375 + endloop +endfacet +facet normal 0.42261833 0 -0.90630776 + outer loop + vertex 5.755354 -4 1.5 + vertex 4.146974 -4 0.75 + vertex 4.146974 -0 0.75 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 5.755354 -4 1.5 + vertex 5.755354 -0 1.5 + vertex 9.5 -4 1.5 + endloop +endfacet +facet normal 0 0 -1 + outer loop + vertex 9.5 -4 1.5 + vertex 5.755354 -0 1.5 + vertex 9.5 -0 1.5 + endloop +endfacet +facet normal 1 0 0 + outer loop + vertex 9.5 -4 1.5 + vertex 9.5 -0 1.5 + vertex 9.5 -4 2 + endloop +endfacet +facet normal 1 -0 0 + outer loop + vertex 9.5 -4 2 + vertex 9.5 -0 1.5 + vertex 9.5 -0 2 + endloop +endfacet +facet normal 0 -0 1 + outer loop + vertex 9.5 -4 2 + vertex 9.5 -0 2 + vertex 5.644507 -4 2 + endloop +endfacet +facet normal 0 0 1 + outer loop + vertex 5.644507 -4 2 + vertex 9.5 -0 2 + vertex 5.644507 -0 2 + endloop +endfacet +facet normal -0.42261824 0 0.90630776 + outer loop + vertex 5.644507 -4 2 + vertex 5.644507 -0 2 + vertex 3.5 -4 1 + endloop +endfacet +facet normal -0.42261824 0 0.90630776 + outer loop + vertex 3.5 -4 1 + vertex 5.644507 -0 2 + vertex 3.5 -0 1 + endloop +endfacet +facet normal 0 -0 1 + outer loop + vertex 3.5 -4 1 + vertex 3.5 -0 1 + vertex 0 -4 1 + endloop +endfacet +facet normal 0 0 1 + outer loop + vertex 0 -4 1 + vertex 3.5 -0 1 + vertex 0 -0 1 + endloop +endfacet +facet normal -1 0 0 + outer loop + vertex 0 -4 1 + vertex 0 -0 1 + vertex 0 -4 0 + endloop +endfacet +facet normal -1 0 0 + outer loop + vertex 0 -4 0 + vertex 0 -0 1 + vertex 0 -0 0 + endloop +endfacet +facet normal 0 1 -0 + outer loop + vertex 3.342784 -0 0.375 + vertex 2.5385938 -0 0 + vertex 3.5 -0 1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 3.4311862 -0 -0.625 + vertex 4.323779 -0 -1.25 + vertex 3.0950184 -0 -1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 3.342784 -0 0.375 + vertex 3.5 -0 1 + vertex 4.146974 -0 0.75 + endloop +endfacet +facet normal 0 0.99999994 0 + outer loop + vertex 4.323779 -0 -1.25 + vertex 5.9513144 -0 -3 + vertex 3.0950184 -0 -1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 0 -0 -1 + vertex 2.5385938 -0 0 + vertex 3.0950184 -0 -1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 0 -0 -1 + vertex 0 -0 0 + vertex 2.5385938 -0 0 + endloop +endfacet +facet normal 0 0.99999994 -0 + outer loop + vertex 9.5 -0 -3 + vertex 6.108964 -0 -2.5 + vertex 9.5 -0 -2.5 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 9.5 -0 -3 + vertex 5.9513144 -0 -3 + vertex 6.108964 -0 -2.5 + endloop +endfacet +facet normal 0 1 -0 + outer loop + vertex 5.9513144 -0 -3 + vertex 4.323779 -0 -1.25 + vertex 6.108964 -0 -2.5 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 5.644507 -0 2 + vertex 5.755354 -0 1.5 + vertex 4.146974 -0 0.75 + endloop +endfacet +facet normal 0 0.99999994 -0 + outer loop + vertex 3.0950184 -0 -1 + vertex 2.5385938 -0 0 + vertex 3.4311862 -0 -0.625 + endloop +endfacet +facet normal 0 1 -0 + outer loop + vertex 4.146974 -0 0.75 + vertex 3.5 -0 1 + vertex 5.644507 -0 2 + endloop +endfacet +facet normal 0 1 -0 + outer loop + vertex 9.5 -0 1.5 + vertex 5.755354 -0 1.5 + vertex 9.5 -0 2 + endloop +endfacet +facet normal 0 1 -0 + outer loop + vertex 5.755354 -0 1.5 + vertex 5.644507 -0 2 + vertex 9.5 -0 2 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 2.5385938 -0 0 + vertex 0 -0 0 + vertex 0 -0 1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 3.5 -0 1 + vertex 2.5385938 -0 0 + vertex 0 -0 1 + endloop +endfacet +facet normal -0 -1 0 + outer loop + vertex 3.342784 -4 0.375 + vertex 3.5 -4 1 + vertex 2.5385938 -4 0 + endloop +endfacet +facet normal -0 -1 0 + outer loop + vertex 4.146974 -4 0.75 + vertex 3.5 -4 1 + vertex 3.342784 -4 0.375 + endloop +endfacet +facet normal 0 -1 -0 + outer loop + vertex 3.4311862 -4 -0.625 + vertex 3.0950184 -4 -1 + vertex 4.323779 -4 -1.25 + endloop +endfacet +facet normal 0 -0.99999994 0 + outer loop + vertex 4.146974 -4 0.75 + vertex 5.755354 -4 1.5 + vertex 5.644507 -4 2 + endloop +endfacet +facet normal 0 -1 0 + outer loop + vertex 0 -4 1 + vertex 2.5385938 -4 0 + vertex 3.5 -4 1 + endloop +endfacet +facet normal 0 -1 0 + outer loop + vertex 0 -4 1 + vertex 0 -4 0 + vertex 2.5385938 -4 0 + endloop +endfacet +facet normal 0 -1 0 + outer loop + vertex 5.644507 -4 2 + vertex 5.755354 -4 1.5 + vertex 9.5 -4 2 + endloop +endfacet +facet normal 0 -1 -0 + outer loop + vertex 9.5 -4 2 + vertex 5.755354 -4 1.5 + vertex 9.5 -4 1.5 + endloop +endfacet +facet normal 0 -1 0 + outer loop + vertex 4.146974 -4 0.75 + vertex 5.644507 -4 2 + vertex 3.5 -4 1 + endloop +endfacet +facet normal 0 -0.99999994 0 + outer loop + vertex 2.5385938 -4 0 + vertex 3.0950184 -4 -1 + vertex 3.4311862 -4 -0.625 + endloop +endfacet +facet normal -0 -0.99999994 -0 + outer loop + vertex 4.323779 -4 -1.25 + vertex 3.0950184 -4 -1 + vertex 5.9513144 -4 -3 + endloop +endfacet +facet normal -0 -1 0 + outer loop + vertex 6.108964 -4 -2.5 + vertex 4.323779 -4 -1.25 + vertex 5.9513144 -4 -3 + endloop +endfacet +facet normal -0 -0.99999994 -0 + outer loop + vertex 9.5 -4 -2.5 + vertex 6.108964 -4 -2.5 + vertex 9.5 -4 -3 + endloop +endfacet +facet normal 0 -1 -0 + outer loop + vertex 6.108964 -4 -2.5 + vertex 5.9513144 -4 -3 + vertex 9.5 -4 -3 + endloop +endfacet +facet normal 0 -1 -0 + outer loop + vertex 2.5385938 -4 0 + vertex 0 -4 -1 + vertex 3.0950184 -4 -1 + endloop +endfacet +facet normal 0 -1 0 + outer loop + vertex 0 -4 -1 + vertex 2.5385938 -4 0 + vertex 0 -4 0 + endloop +endfacet +endsolid unnamed diff --git a/e2e/playwright/export-snapshots/stl-binary.stl b/e2e/playwright/export-snapshots/stl-binary.stl new file mode 100644 index 0000000000000000000000000000000000000000..3ff0d216716ac2b134725b7ba82c7b2bb61dae6b GIT binary patch literal 3484 zcmb`JziL%M5XKks2EoGeVjG_!X9cm3V5NmNA_#(=h2Ruc7S?uNe1)X2%2}{c!7^ZB zD_DwR9p~HGx%2JabHKudkU6{an{RgZ-%aWNwwpDa%zacT^ethd-+Y&dT^|ui?OlHj zyQ|m7E4Q+mWh53xh;WS`7l(BozfVtQCd@Xkqo?OhBdZP*JTelXK}3_83A5en z>J6L6K9N$4jD*w5PN5To(eCB_n*!fT2&~Y+2)vkpZG`sg$mQh=)#6xAY|6XmAF{fX zjz}Q-k$u87zF!>HdHgv&nO?uS>#^pC_g*!7+iVb9T{~TmO8ioSy;#p|*I>dl>d1Wi z*)`RGos!v@2U;Tp8l2TgFA-x_mWlPl#yrNETUM;s6OSK!Jw|q)4<60ef8NPf_j1g+ z^PEy*;^6FMBl5(w+0ZT;oe3T>8eVzgNGUyOS$)#1*z4QTd)2FPC$mwjqH8y5)R8t1 z5Gk>Cufef66V^rqZ!$B%S;d}4R?%?#_--#Pcbi9?6(j12YG4q(m-nX($4UsS(7=eF z55#rbi0Udva;)(B^7c$4)SamRqsi2d>=U)pO6Yo=gVGi32&3KWzIs9fGhia67#RuB zRHgP6gwgEf8fn*@_Yu%cgzfK!qfXRsiA>OMZHe%)h^sxa>%|B5i|`)p&)tw=s{!91 ze75;5aUGjAYjCZ`-EOyZN*tHpk9CcvC_1I?PW(3_Xun0dRxK-y?Yl3xHv?Xq68*5P z`FaPz^XTt(B80uT3adoo{mM7PYITKc!fVbe+s#AzSg|u$yCD_$wCE?3kngtpeQjqG{aOFCiC33@w=q2ut`Rfe o|NV*GP8yKGnhR_6an}f*xkf;cf@oZY+KrLAuk6dbmT7qW1p=VQUH||9 literal 0 HcmV?d00001 diff --git a/e2e/playwright/snapshot-tests.spec.ts b/e2e/playwright/snapshot-tests.spec.ts index 8d46bb8732..49f4ca885a 100644 --- a/e2e/playwright/snapshot-tests.spec.ts +++ b/e2e/playwright/snapshot-tests.spec.ts @@ -233,6 +233,9 @@ const part001 = startSketchOn('-XZ') forward: axisDirectionPair, up: axisDirectionPair, } + // NOTE it was easiest to leverage existing types and have doExport take Models['OutputFormat_type'] as in input + // just note that only `type` and `storage` are used for selecting the drop downs is the app + // the rest are only there to make typescript happy await doExport({ type: 'step', coords: sysType, @@ -252,34 +255,45 @@ const part001 = startSketchOn('-XZ') storage: 'standard', presentation: 'pretty', }) + await doExport({ + type: 'ply', + coords: sysType, + selection: { type: 'default_scene' }, + storage: 'ascii', + units: 'in', + }) + await doExport({ + type: 'ply', + storage: 'binary_little_endian', + coords: sysType, + selection: { type: 'default_scene' }, + units: 'in', + }) + await doExport({ + type: 'ply', + storage: 'binary_big_endian', + coords: sysType, + selection: { type: 'default_scene' }, + units: 'in', + }) + await doExport({ + type: 'stl', + storage: 'ascii', + coords: sysType, + units: 'in', + selection: { type: 'default_scene' }, + }) + await doExport({ + type: 'stl', + storage: 'binary', + coords: sysType, + units: 'in', + selection: { type: 'default_scene' }, + }) await doExport({ // obj seems to be a little flaky, times out tests sometimes type: 'obj', coords: sysType, units: 'in', }) - - // the following exports are failing - // await doExport({ - // type: 'ply', - // storage: 'ascii', - // coords: sysType, - // }) - // await doExport({ - // type: 'ply', - // storage: 'binary' as unknown as 'binary_little_endian', - // coords: sysType, - // }) - // await doExport({ - // type: 'stl', - // storage: 'ascii', - // coords: sysType, - // units: 'in', - // }) - // await doExport({ - // type: 'stl', - // storage: 'binary', - // coords: sysType, - // units: 'in', - // }) }) diff --git a/package.json b/package.json index 74c3dcd9a6..4706c50b7c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@fortawesome/react-fontawesome": "^0.2.0", "@headlessui/react": "^1.7.17", "@headlessui/tailwindcss": "^0.2.0", - "@kittycad/lib": "^0.0.45", + "@kittycad/lib": "^0.0.46", "@lezer/javascript": "^1.4.7", "@open-rpc/client-js": "^1.8.1", "@react-hook/resize-observer": "^1.2.6", diff --git a/src/components/ExportButton.tsx b/src/components/ExportButton.tsx index 11865ce3df..2cc17e0460 100644 --- a/src/components/ExportButton.tsx +++ b/src/components/ExportButton.tsx @@ -75,7 +75,11 @@ export const ExportButton = ({ children, className }: ExportButtonProps) => { }, } } - if (values.type === 'obj' || values.type === 'stl') { + if ( + values.type === 'obj' || + values.type === 'stl' || + values.type === 'ply' + ) { values.units = baseUnit } if ( @@ -86,6 +90,9 @@ export const ExportButton = ({ children, className }: ExportButtonProps) => { // Set the storage type. values.storage = storage } + if (values.type === 'ply' || values.type === 'stl') { + values.selection = { type: 'default_scene' } + } engineCommandManager.sendSceneCommand({ type: 'modeling_cmd_req', cmd: { @@ -177,13 +184,13 @@ export const ExportButton = ({ children, className }: ExportButtonProps) => { )} - {type === 'ply' && ( + {type === 'stl' && ( <> )} - {type === 'stl' && ( + {type === 'ply' && ( <>