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

Is it possible to split a polyhedron by a plane using scikit-geometry? #89

Open
prince2110 opened this issue Dec 17, 2021 · 2 comments
Open

Comments

@prince2110
Copy link

I find scikit-geometry to be a very cool project and I am highly interested to use it in my personal project. I am not sure if I will be able to split a parent polyhedron (3D) using a plane (2D) into 2 child closed polyhedrons. Is it possible to do it with scikit-geometry?

Note: It is not an issue but a question regarding capabilities of the library.

@prince2110
Copy link
Author

Could you please mention how to generate polyhedron using Polyhedron_3?

poly = sg.Polyhedron_3([sg.Point3(0, 0, 0),
                        sg.Point3(1, 0, 0),
                        sg.Point3(1, 1, 0),
                        sg.Point3(0, 1, 0),
                        sg.Point3(0, 0, 1),
                        sg.Point3(1, 0, 1),
                        sg.Point3(1, 1, 1),
                        sg.Point3(0, 1, 1)])

draw(poly)

Above code gives following error:

Traceback (most recent call last):
  File "scikit_geometry.py", line 12, in <module>
    poly = sg.Polyhedron_3([sg.Point3(0, 0, 0),
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. skgeom._skgeom.Polyhedron_3()
    2. skgeom._skgeom.Polyhedron_3(arg0: skgeom._skgeom.Polyhedron_3)

Invoked with: [PointC3(0, 0, 0), PointC3(1, 0, 0), PointC3(1, 1, 0), PointC3(0, 1, 0), PointC3(0, 0, 1), PointC3(1, 0, 1), PointC3(1, 1, 1), PointC3(0, 1, 1)]

Please Help!

@mvnayagam
Copy link

Hi everyone,
I am also getting the same error.
it would be nice if the developer explains shortly how to define Polyhedron3, this would be help all in future

here is how I do the process

import skgeom
a = skgeom.Point3(4, 5, 4)
b = skgeom.Point3(2, 1, 4)
c = skgeom.Point3(3, 6, 4)
d = skgeom.Point3(5, 2, 4)
print('a:', a)

skgeom.Polyhedron3([a, b, c, d])

thank you in advance

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

No branches or pull requests

2 participants