static private final List<Point3f> transform(final Transform3D t, final List<Point3f> plane, final float x, final float y, final float z, final float radius) { final List<Point3f> ps = new ArrayList<Point3f>(plane.size()); for (final Point3f p2 : plane) { final Point3f p = new Point3f(p2); p.scale(radius); t.transform(p); p.x += x; p.y += y; p.z += z; ps.add(p); } return ps; }
public void normalizeCoords(final Point3f min, final Point3f max) { final float dx = max.x - min.x; final float dy = max.y - min.y; final float dz = max.z - min.z; final float maxd = Math.max(dx, Math.max(dy, dz)); final Point3f center = new Point3f(); center.add(min, max); center.scale(0.5f); for (final Point3f p : coords) { p.sub(center); p.scale(1 / maxd); } }
/** * A little function that translates an analysis point to * an AWT point. * * @param Point - Analysis point * @return Point3f - AWT point */ private Point3f point2point3f(Point point) { float x, y, z; // x = (point.x - (width / 2.0f)) / width; // y = (point.y - (height / 2.0f)) / height; // z = (point.z - (depth / 2.0f)) / depth; x = (point.x) / width; y = (point.y) / height; // z = (point.z) / depth; z = (point.z) / height; Point3f point3f = new Point3f(x, y, z); point3f.scale(INITIAL_SCALE); return point3f; }
void getMidpoint(final CEdge e, final Point3f ret) { final Point3f p1 = mesh.get(e.meshIdx).getVertex(e.edge.p1); final Point3f p2 = mesh.get(e.meshIdx).getVertex(e.edge.p2); ret.add(p1, p2); ret.scale(0.5f); }
private void calculateMinMaxCenterPoint() { min = new Point3f(); max = new Point3f(); center = new Point3f(); if (customMeshes.isEmpty()) return; customMeshes.get(0).calculateMinMaxCenterPoint(min, max, center); final Point3f mint = new Point3f(); final Point3f maxt = new Point3f(); final int n = customMeshes.size(); if (n == 1) return; for (int i = 1; i < n; i++) { final CustomMesh mesh = customMeshes.get(i); mesh.calculateMinMaxCenterPoint(mint, maxt, center); adjustMinMax(mint, min, max); adjustMinMax(maxt, min, max); } center.sub(max, min); center.scale(0.5f); }
/** * computes the interpolated point along a specified whose intensity equals * the reference value * * @param v1 first extremity of the edge * @param v2 second extremity of the edge * @param result stores the resulting edge return the point on the edge where * intensity equals the isovalue; * @return false if the interpolated point is beyond edge boundaries */ private boolean computeEdge(final Point3f v1, final int i1, final Point3f v2, final int i2, final Point3f result, final Carrier car) { // 30 --- 50 --- 70 : t=0.5 // 70 --- 50 --- 30 : t=0.5 // /int i1 = car.intensity(v1); // /int i2 = car.intensity(v2); if (i2 < i1) return computeEdge(v2, i2, v1, i1, result, car); final float t = (car.threshold - i1) / (i2 - i1); if (t >= 0 && t <= 1) { // v1 + t*(v2-v1) result.set(v2); result.sub(v1); result.scale(t); result.add(v1); return true; } result.set(-1, -1, -1); return false; }
/** * computes the interpolated point along a specified whose * intensity equals the reference value * @param v1 first extremity of the edge * @param v2 second extremity of the edge * @param result stores the resulting edge * return the point on the edge where intensity equals the isovalue; * @return false if the interpolated point is beyond edge boundaries */ private boolean computeEdge(final Point3f v1, final int i1, final Point3f v2, final int i2, final Point3f result, final Carrier car) { // 30 --- 50 --- 70 : t=0.5 // 70 --- 50 --- 30 : t=0.5 ///int i1 = car.intensity(v1); ///int i2 = car.intensity(v2); if(i2 < i1) return computeEdge(v2, i2, v1, i1, result, car); final float t = (car.threshold - i1) / (float) (i2 - i1); if (t >= 0 && t <= 1) { // v1 + t*(v2-v1) result.set(v2); result.sub(v1); result.scale(t); result.add(v1); return true; } result.set(-1, -1, -1); return false; }
workingPosition.scale(1.0f/distanceSourceToCenterEar); if (debugFlag) debugPrint(" workingPosition after unitization " +
capNormals[i] = new Vector3f(normal) ; cap0[i] = new Point3f(normal) ; cap0[i].scale(halfWidth) ; cap1[i] = new Point3f(cap0[i]) ; cap1[i].add(axis) ;