Skip to content

[ENHANCEMENT] Add fillet and radius parameter to Workplane.rect() method #746

@Jojain

Description

@Jojain

Hello,

I found myself needing to have a rounded rectangle to loft to, and realized that rect() doesn't have, fillet or chamfer parameters.
Since offset2D and chamfer2D have been implemented some time ago I think supporting this could be nice.

Looking at the source code for rect() it doesn't seems too complicated to implement.

For reference here a quick plugin I made that do rounded rect :

def rounded_rect(self, xlen, ylen, fillet_radius):
    rect = cq.Workplane().rect(xlen, ylen).val()
    pts = rect.Vertices()
    rect = rect.fillet2D(fillet_radius, pts)
    return self.eachpoint(lambda loc: rect.moved(loc), True)
cq.Workplane.rounded_rect = rounded_rect

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions