public void update(double x, double y, double z, int updateSize) { sampleSize += updateSize; double nInv = (double) updateSize / (double) sampleSize; this.setX(this.getX() + (x - this.getX()) * nInv); this.setY(this.getY() + (y - this.getY()) * nInv); this.setZ(this.getZ() + (z - this.getZ()) * nInv); }
public void clear() { sampleSize = 0; set(0.0, 0.0, 0.0); }
public void update(double x, double y, double z) { update(x, y, z, 1); }
public void recomputeNormalAndOrigin() { pca.clear(); nodes.stream().forEach(node -> pca.addPoint(node.getHitLocationX(), node.getHitLocationY(), node.getHitLocationZ())); pca.compute(); Point3D mean = new Point3D(); pca.getMean(mean); point.clear(); point.update(mean, getNumberOfNodes()); Vector3D thirdVector = new Vector3D(); pca.getThirdVector(thirdVector); pca.getStandardDeviation(standardDeviationPrincipalValues); if (thirdVector.dot(normal) < 0.0) thirdVector.negate(); normal.clear(); normal.update(thirdVector, getNumberOfNodes()); }
public static Point3D computeAverage(List<PlanarRegionSegmentationRawData> regionsRawData, Set<Integer> regionIdFilterSet) { PointMean average = new PointMean(); for (PlanarRegionSegmentationRawData rawData : regionsRawData) { if (regionIdFilterSet.isEmpty() || regionIdFilterSet.contains(rawData.getRegionId())) rawData.stream().forEach(average::update); } return average; }
public void update(Tuple3DBasics tuple, int updateSize) { update(tuple.getX(), tuple.getY(), tuple.getZ(), updateSize); }
public void update(Tuple3DBasics tuple) { update(tuple.getX(), tuple.getY(), tuple.getZ()); }
private void updateNormalAndOriginOnly(NormalOcTreeNode node) { node.getNormal(temporaryVector); // TODO Review and possibly improve dealing with normal flips. if (getNumberOfNodes() >= 1 && temporaryVector.dot(normal) < 0.0) temporaryVector.negate(); normal.update(temporaryVector); point.update(node.getHitLocationX(), node.getHitLocationY(), node.getHitLocationZ()); }