# HG changeset patch # User Sascha L. Teichmann # Date 1552475602 -3600 # Node ID c7ce8b011bcbac8284437bff9bfeda9f349b22bd # Parent e8c97481438f3ebc17bd38045f658f878994db30 SR import: Negate negative Z values and issue a warning if a negative Z value is found. diff -r e8c97481438f -r c7ce8b011bcb pkg/imports/sr.go --- a/pkg/imports/sr.go Wed Mar 13 11:28:46 2019 +0100 +++ b/pkg/imports/sr.go Wed Mar 13 12:13:22 2019 +0100 @@ -426,6 +426,8 @@ mpz := make(octree.MultiPointZ, 0, 250000) s := bufio.NewScanner(r) + var hasNegZ bool + for line := 1; s.Scan(); line++ { text := s.Text() var p octree.Vertex @@ -454,6 +456,13 @@ feedback.Warn("format error in line %d: %v", line, err) continue } + if p.Z < 0 { + p.Z = -p.Z + if !hasNegZ { + hasNegZ = true + feedback.Warn("Negative Z value found: Using -Z") + } + } mpz = append(mpz, p) }