replicad icon indicating copy to clipboard operation
replicad copied to clipboard

Fix mirror types

Open ahdinosaur opened this issue 1 year ago • 2 comments

Hi, thanks for replicad. Made a few models now. Appreciate the workbench, code interface, and documentation. Am coming from OpenSCAD, so I love the fillets and such. Cheers :purple_heart:

Anyways, here's a very basic pull request to fix the TypeScript types of .mirror().

Is there a way setup to test the TypeScript types?

ahdinosaur avatar Jun 25 '24 11:06 ahdinosaur

Hei, thanks a lot for the PR! I am not sure why you think these types are broken. The plane and inputOrigin are used by the Transformation.mirror method that will take care of missing values.

Is there a way setup to test the TypeScript types?

I have my editor complain when the types are broken, and the build fails - so normally they are internally consistent!

sgenoud avatar Jul 05 '24 06:07 sgenoud

I am not sure why you think these types are broken. The plane and inputOrigin are used by the Transformation.mirror method that will take care of missing values.

Yeah, plane and origin are optional in Transformation.mirror, but currently are required in these methods that wrap Transformation.mirror. I came across this problem when calling .mirror() on a shape, I only wanted to pass in the plane but TypeScript was telling me both arguments were required. Hope that makes sense.

ahdinosaur avatar Jul 08 '24 02:07 ahdinosaur