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

The shadow method Transformer.transformCollection prevents space.Geometry.Simplify() to work correctly #92

Open
andreacomparini opened this issue Nov 18, 2022 · 0 comments

Comments

@andreacomparini
Copy link

Using DP geometry simplification I noted that the shadow method tranformCollection() in Tranformer obscure the call at a missing method in DPTransformer and the call at space.Geometry.Simplify() doesn't work in case of geometry collection.
I suppose the following method has to be added for DPTransformer.

func (d *DPTransformer) transformCollection(geom matrix.Collection, parent matrix.Steric) matrix.Steric {
	transGeoms := matrix.Collection{}
	for _, v := range geom {
		transformGeom, _ := d.Transform(v)
		if transformGeom == nil {
			continue
		}
		if d.pruneEmptyGeometry && transformGeom.IsEmpty() {
			continue
		}
		transGeoms = append(transGeoms, transformGeom)
	}
	return transGeoms
}
@andreacomparini andreacomparini changed the title The shadow method Transform.transformCollection prevents space.Geometry.Simplify() to work correctly The shadow method Transformer.transformCollection prevents space.Geometry.Simplify() to work correctly Nov 18, 2022
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

1 participant