Skip to content

Lost last point when contour is not closed line #1

@sawyerzhu

Description

@sawyerzhu

For example this 2x2 grid.

func main() {
	width := 2
	height := 2
	grid := make([]float64, width*height)

	for i := 0; i < width*height; i++ {
		grid[i] = float64(i)
	}

	m := contourmap.FromFloat64s(width, height, grid)

	contours := m.Contours(1.5)

	for _, contour := range contours {
		fmt.Print("[")
		for i, point := range contour {
			if i > 0 {
				fmt.Print(", ")
			}

			fmt.Print(point.X, point.Y)
		}

		fmt.Println("]")
	}
}

The output is [0 0.75] just a point not a line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions