dcowden / cadquery

CadQuery-- a parametric cad script framework
Other
432 stars 56 forks source link

Add rotate Function to CQ Object #51

Closed jmwright closed 9 years ago

jmwright commented 9 years ago

The CQ object has translate() and rotateAboutCenter() functions, but not a rotate() function. That's only on cad.Shape.

http://parametricparts.com/docs/search.html?q=rotate

Why is that?

dcowden commented 9 years ago

No good reason comes to mind. On Dec 1, 2014 4:37 PM, "Jeremy Wright" notifications@github.com wrote:

The CQ object has translate() and rotateAboutCenter() functions, but not a rotate() function. That's only on cad.Shape.

http://parametricparts.com/docs/search.html?q=rotate

Why is that?

— Reply to this email directly or view it on GitHub https://github.com/dcowden/cadquery/issues/51.

jmwright commented 9 years ago

I'd like to convert this to an enhancement request then. It's kind of a picky semantic thing, but I like consistency.

dcowden commented 9 years ago

fair enough!

On Mon, Dec 1, 2014 at 9:50 PM, Jeremy Wright notifications@github.com wrote:

I'd like to convert this to an enhancement request then. It's kind of a picky semantic thing, but I like consistency.

— Reply to this email directly or view it on GitHub https://github.com/dcowden/cadquery/issues/51#issuecomment-65176040.

jmwright commented 9 years ago

Looking at the Shape.rotate signature...

def rotate(self, startVector, endVector, angleDegrees):

If we changed the signature to something like...

def rotate(self, startVector=(0, 0, 0), endVector=(0, 0, 1), angleDegrees=90):

...it would chose sane defaults for the user.

Thoughts?

jmwright commented 9 years ago

I'm wondering if we can replace rotateAboutCenter by setting the right defaults if the user doesn't pass anything in for the start and end vectors. We'd have to check for None to make it work I think, which isn't the cleanest way to handle things, but I think we could make it work.

dcowden commented 9 years ago

yeah that seems workable.

On Wed, Dec 10, 2014 at 10:53 AM, Jeremy Wright notifications@github.com wrote:

I'm wondering if we can replace rotateAboutCenter http://parametricparts.com/docs/classreference.html?highlight=rotate#cadfile.cadutils.cadquery.CQ.rotateAboutCenter by setting the right defaults if the user doesn't pass anything in for the start and end vectors. We'd have to check for None to make it work I think, which isn't the cleanest way to handle things, but I think we could make it work.

— Reply to this email directly or view it on GitHub https://github.com/dcowden/cadquery/issues/51#issuecomment-66472692.

jmwright commented 9 years ago

The reason for this being marked as wontfix is outlined in issue #34

jmwright commented 9 years ago

I decided to stop waffling and just add this. It's in commit 65381225d0b77084d20dece2821f336e446b447c

dcowden commented 9 years ago

okie doke

On Fri, Dec 19, 2014 at 9:40 AM, Jeremy Wright notifications@github.com wrote:

I decided to stop waffling and just add this. It's in commit 6538122 https://github.com/dcowden/cadquery/commit/65381225d0b77084d20dece2821f336e446b447c

— Reply to this email directly or view it on GitHub https://github.com/dcowden/cadquery/issues/51#issuecomment-67645637.