Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planar surface #1590

Open
OmarZaki96 opened this issue May 23, 2024 · 1 comment
Open

Planar surface #1590

OmarZaki96 opened this issue May 23, 2024 · 1 comment
Labels
question Further information is requested

Comments

@OmarZaki96
Copy link

OmarZaki96 commented May 23, 2024

I have a simple code that generate a box

rectangular_prism = cq.Workplane("XY").box(1, 1, 1)

I want to add a rectangular planar selectable surface at the top face, with dimensions 0.5x0.5.

How can I create planar surfaces (or zero thickness surface) in CadQuery?

@OmarZaki96 OmarZaki96 added the question Further information is requested label May 23, 2024
@adam-urbanczyk
Copy link
Member

I'll plug the free function API here (you'll have to be on master):

from cadquery.occ_impl.shapes import *

# start with a box
b = box(1,1,1)

# split int top face and others
f_top = b.faces('>Z')
f_rest = b.faces('not >Z')

# create the new top face
f_new = f_top + plane(0.5,0.5).moved(f_top.Center())

# assemble into a solid
res = solid(f_rest,f_new)

show_object(res)

afbeelding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants