CompoundGeometry.from_points with control_points=None
See original GitHub issueDescribe the bug
When using CompoundGeometry.from_points
with control_points=None, the class method fails.
To Reproduce
import sectionproperties.pre.sections as sections
from sectionproperties.analysis.cross_section import Section
points = [[0,0], [0,1], [1,1], [1,0], [1,0.25], [1,0.75], [2,0.75], [2,0.25] ]
facets = [[0,1], [1,2], [2,5],[5,4], [4,3], [3,0], [4,5], [5,6], [6,7], [7,4]]
holes = []
geometry = sections.CompoundGeometry.from_points(points, facets, holes)
TypeError: 'NoneType' object is not iterable
originating at here
Expected behaviour With control_points=None and material=None, I would expect Shapely representative points to be generated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Geometry of Molecules - Chemistry LibreTexts
Molecular geometry, also known as the molecular structure, is the three-dimensional structure or arrangement of atoms in a molecule.
Read more >Creating Geometries, Meshes, and Material Properties
An interface for the creation of CompoundGeometry objects through the definition of points, facets, holes, and control_points. Geometries created through ...
Read more >arcgis.geometry module | ArcGIS API for Python
The arcgis.geometry module defines useful geometry types for working with ... These fields control the interpretation of elements of the points array.
Read more >VSEPR Theory and How to Determine the Shape of a Molecule
Ketzbook explains molecular geometry, VSEPR theory, and the 5 basic shapes of molecules with ... Intermolecular Forces and Boiling Points.
Read more >[IR SS2] Generate H & V geometry from point elements?
Create Alignment from COGO points looks promising also, ... DTM but should not be considered as part of an alignment/ control geometry.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@connorferster The “possible scenarios” you showed, are the exact complexity issue I was beginning to see myself, by allowing control_points=None in CompoundGeometry.
My intent behind this issue, was that I feel that for the user it would be ambiguous to allow control_points=None in Geometry and not allow control_points=None in CompoundGeometry. I feel this way about the behavior of the two functions in general, what the one does the other should do. That said, fundamentally there is nothing wrong with allowing different behaviors, and I see many viable solutions here:
I think 4 is the most difficult solution as we then have to look hard at the whole library and consider other deprecations.
I see 3 as a doable but perhaps difficult solution. I also agree with Robbie’s feelings questioning scope. I can see another issue looming: a user will put in one set of data (say facets), and different data could come out! I think this would happen in “possible scenarios” 4 (two overlapping rectangles). A facet list goes in, and all of a sudden the facet list is now modified with additional entries, etc. I think a user may find this confusing. If this is not clear, let me know and I can make an example.
I see 1 and 2 as more or less equal, easy enough to implement. 2 would mean the user would have to be 100% explicit about the control_points, while reducing convenience.
If I’m missing solutions let me know.
Baaaammm! Nailed it.
Will write some new tests for
CompoundGeometry.from_points()
and add a new section to Advanced Geometry in the docs before submitting the PR but here is the more robust.from_points()
algorithm at work: