Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Add mirroring operation for 3D CQ object and add tessellate(0.1) in the BoundBox function #134

Merged
merged 6 commits into from
Jan 22, 2016

Conversation

huskier
Copy link
Contributor

@huskier huskier commented Dec 30, 2015

  1. Add a mirror function into CQ class(wrap) and Shape class(implement);
  2. To get precise BoundBox, add tessellate(0.000001) in the BoundBox function implement.

Thanks for reviewing the pull request!

…t); 2. To get precise BoundBox, add tessellate(0.000001) in the BoundBox function implement......
@dcowden
Copy link
Owner

dcowden commented Dec 31, 2015

are there any tests that go with this behavior?
for the mirror functionality, an addition to doc/examples.rst would be great-- that would allow an easy way to visually confirm that the mirror works, and provide, at the same time, an example of how to use it.

a test case for the tessellate function might be good as well. that woud probably belong in tests/TestCadQuery.py

@huskier
Copy link
Contributor Author

huskier commented Dec 31, 2015

@dcowden Yes, I test the mirror functionality myself. Following your suggestion, I will work on the example and test things.

For the BoundingBox function:
Do we need to pass a precision parameter into the BoundingBox function?

@dcowden
Copy link
Owner

dcowden commented Dec 31, 2015

That's a good question. It is not intuitive that bounding box needs a
precision, but on the other hand using a hard coded, very small value
might be very computationally expensive, and that could be surprising too.

For example, how long does it take to tessellate a sphere to tolerance
0.000001?

I think we should probably add a tolerance parameter, and default the value
to a number more like 0.001.

My rationale for that number is that it is the largest power of ten that
would still be considered 'small' when the model unit of measure is inches
or mm or cm, which are the most common units

We should use a larger default precision if it turns out that even that
value is costly for curved surfaces.
On Dec 30, 2015 10:12 PM, "huskier" notifications@github.com wrote:

@dcowden https://github.com/dcowden Yes, I test the mirror
functionality myself. Following your suggestion, I will work on the example
and test things.

For the BoundingBox function:
Do we need to pass a precision parameter into the BoundingBox function?


Reply to this email directly or view it on GitHub
#134 (comment).

huskier and others added 5 commits December 31, 2015 12:34
…t); 2. To get precise BoundBox, add tessellate(0.000001) in the BoundBox function implement......
…arameter into BoundingBox function, and default it as 0.1, otherwise, it's very slow when compile the docs with sphinx-build, don't know why; 3. Add a testBoundingBox function into TestCadQuery.py file...
@huskier
Copy link
Contributor Author

huskier commented Jan 20, 2016

I add a mirroring example into doc/example.rst, and also add a test function testBoundingBox into tests/TestCadQuery.py file. For the tolerance of BoundingBox, it is very slow to compile the docs with sphinx-build when I set the it to 0.001, so I default it to 0.1 at present.

One more thing, the mirroring operation only works on the first object of the current CQ stack. I don't know whether it matters?

Thank you for your reviewing!

@huskier huskier changed the title Add mirroring operation for 3D CQ object and add tessellate(0.000001) in the BoundBox function Add mirroring operation for 3D CQ object and add tessellate(0.1) in the BoundBox function Jan 20, 2016
dcowden added a commit that referenced this pull request Jan 22, 2016
Add mirroring operation for 3D CQ object and add tessellate(0.1) in the BoundBox function
@dcowden dcowden merged commit 9922755 into dcowden:master Jan 22, 2016
@dcowden
Copy link
Owner

dcowden commented Jan 22, 2016

Thanks for adding the test and the documentation!
And thanks for the contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants