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

Solid from single face does not work #531

Closed
MatthiasJ1 opened this issue Feb 3, 2024 · 3 comments
Closed

Solid from single face does not work #531

MatthiasJ1 opened this issue Feb 3, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@MatthiasJ1
Copy link
Contributor

This should produce a sphere

section = Rot(90)*CenterArc((0,0), 5, 90, 180)
path = Circle(5).wire()
shell = Shell(sweep(section, path))
solid = Solid(shell)
    return ShapeFix_Solid().SolidFromShell(shell.wrapped)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SolidFromShell(): incompatible function arguments. The following argument types are supported:
    1. (self: OCP.ShapeFix.ShapeFix_Solid, shell: OCP.TopoDS.TopoDS_Shell) -> OCP.TopoDS.TopoDS_Solid

Invoked with: <OCP.ShapeFix.ShapeFix_Solid object at 0x13d194d30>, <OCP.TopoDS.TopoDS_Face object at 0x13d1451f0>
@gumyr gumyr added the wontfix This will not be worked on label Feb 4, 2024
@gumyr
Copy link
Owner

gumyr commented Feb 4, 2024

This is an OCCT limitation - as described before, Shell when given a single Face returns the Face not a Shell. A sphere is the only object that has this limitation, so I guess with OCCT it is not possible to create a Solid this way. There is nothing more that can be done.

@gumyr gumyr closed this as completed Feb 4, 2024
@MatthiasJ1
Copy link
Contributor Author

Not an OCCT limitation and sphere is not the only shape:

section = Rot(90)*Spline((0,-5), (-3,-2), (-2, 0), (-3, 2), (0,5))
face = sweep(section, Circle(5).wire())
builder = BRepBuilderAPI_MakeShell(BRepAdaptor_Surface(face.face().wrapped).Surface().Surface())
solid = Solid(Shell(builder.Shape()))
Screenshot

Also, revolve is broken here which is why I need to sweep a circle

@gumyr gumyr reopened this Feb 4, 2024
@gumyr gumyr added enhancement New feature or request and removed wontfix This will not be worked on labels Feb 4, 2024
@gumyr
Copy link
Owner

gumyr commented Feb 6, 2024

Thanks for pointing this out - I wasn't creative enough to imagine this scenario. I've updated Shell to allow it to accept either a single Face or a list of Faces with a single member.

x_section = Rot(90) * Spline((0, -5), (-3, -2), (-2, 0), (-3, 2), (0, 5))
surface = sweep(x_section, Circle(5).wire())
single_face = Shell(surface.face())
show(single_face)

image

@gumyr gumyr closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants