MCPcopy Create free account
hub / github.com/cogentcore/core / CopyXYZs

Function CopyXYZs

plot/data.go:237–253  ·  view source on GitHub ↗

CopyXYZs copies an XYZer.

(data XYZer)

Source from the content-addressed store, hash-verified

235
236// CopyXYZs copies an XYZer.
237func CopyXYZs(data XYZer) (XYZs, error) {
238 if data.Len() == 0 {
239 return nil, ErrNoData
240 }
241 cpy := make(XYZs, 0, data.Len())
242 for i := range data.Len() {
243 x, y, z := data.XYZ(i)
244 if CheckNaNs(x, y, z) {
245 continue
246 }
247 if err := CheckFloats(x, y, z); err != nil {
248 return nil, err
249 }
250 cpy = append(cpy, XYZ{X: x, Y: y, Z: z})
251 }
252 return cpy, nil
253}
254
255// XYValues implements the XYer interface, returning
256// the x and y values from an XYZer.

Callers

nothing calls this directly

Calls 4

CheckNaNsFunction · 0.85
CheckFloatsFunction · 0.85
LenMethod · 0.65
XYZMethod · 0.65

Tested by

no test coverage detected