Examples of Plane


Examples of toxi.geom.Plane

    float spacing = this.getWidth() / (numSlices);
   
   

    for (float i = (-this.getWidth() / 2); i < (this.getWidth() / 2); i += spacing) {
      SlicePlane slicePlane = new SlicePlane(new Plane(
          new Vec3D(0, 0, i), new Vec3D(0, 0, -1)));
      this.getSlicePlanesY().add(slicePlane);
    }

    //this.updateCollisionShape();
View Full Code Here

Examples of toxi.geom.Plane

  }

  public void importSVG(String path) {
   
    if(this.selectedPlanes.size() == 0){
      SlicePlane slicePlane = new SlicePlane(new Plane(
          new Vec3D(0, 0, 0), new Vec3D(0, 0, -1)));
      slicePlane.importSVG(path);
      this.getSlicePlanesY().add(slicePlane);
     
    }else{
View Full Code Here

Examples of toxi.geom.Plane

    int sign = 1;
    if(Math.atan2(vecDir.x, vecDir.y) < 0){
      sign = -1;
      }
   
    SlicePlane slicePlane = new SlicePlane(new Plane(vecPosStart, vecDir));
   
    slicePlane.setCrossSliceSelection(crossSliceSelection);
    //LOGGER.info("vecDir"+Math.atan2(vecDir.x, vecDir.y));
   
    SketchPath sketchPath = new SketchPath(slicePlane.getSketch());
View Full Code Here

Examples of toxi.geom.Plane

    // TODO: option flush edges
    // Add fake profiles on the ends, this might be a option later for flush
    // edges !
    SlicePlane startSlicePlaneend1 = planesToSlice.getList().get(0);
    SlicePlane slicePlane1 = new SlicePlane(startSlicePlaneend1.getSketch()
        .clone(), new Plane(new Vec3D(0, 0,
        (startSlicePlaneend1.getPlane().z)
            - SETTINGS.chair_slatslot_end_size),
        new Vec3D(0, 0, -1)));
    planesToSlice.add(0, slicePlane1);
    // Add fake profiles on the ends
    SlicePlane startSlicePlaneend2 = planesToSlice
        .get(planesToSlice.size() - 1);
    SlicePlane slicePlane2 = new SlicePlane(startSlicePlaneend2.getSketch()
        .clone(), new Plane(new Vec3D(0, 0,
        (startSlicePlaneend2.getPlane().z)
            + SETTINGS.chair_slatslot_end_size),
        new Vec3D(0, 0, -1)));
    planesToSlice.add(slicePlane2);
    // Add fake profiles on the ends

    float coverWidth = width + (SETTINGS.chair_slatslot_end_size * 2);
    float coverLength = guideSpline.getlength()
        + (SETTINGS_SKETCH.chair_slat_end_size * 2);

    float step = crossSliceSelection.spacing / guideSpline.getlength();

    float start = Math.min(crossSliceSelection.start,
        crossSliceSelection.end);
    float end = Math
        .max(crossSliceSelection.start, crossSliceSelection.end);

    // special case for lines with 2 points
    if (guideSpline.size() == 2) {
      start += step;
      end -= step;
    }

    for (float i = start; i <= end; i += step) {

      Vec3D vecPos = new Vec3D(guideSpline.getPos(i).x,
          guideSpline.getPos(i).y, 0);
      Vec3D vecDir = new Vec3D(guideSpline.getPerpendicular(i).x,
          guideSpline.getPerpendicular(i).y, 0);

      // do we want to add a strenghtening beam to the leg
      if (crossSliceSelection.tieToLeg) {
        SketchPoint point1 = (SketchPoint) guideSpline.get(0);
        SketchPoint point2 = (SketchPoint) guideSpline.get(1);
        Vec2D dir2D = point1.sub(point2).normalize();
        dir2D.rotate((float) (Math.PI / 2));
        vecPos = new Vec3D(point2.x, point2.y, 0);
        vecDir = new Vec3D(dir2D.x, dir2D.y, 0);
      }

      SlicePlane slicePlane = new SlicePlane(new Plane(vecPos, vecDir));
      slicePlane.setCrossSliceSelection(crossSliceSelection);

      // SketchOutline sktOutline = new SketchOutline();

      List<SketchPoint> topLine = new ArrayList<SketchPoint>();
View Full Code Here

Examples of toxi.geom.Plane

      // TODO: option flush edges
      // Add fake profiles on the ends, this might be a option later for
      // flush edges !
      SlicePlane startSlicePlaneend1 = planesToSlice.getList().get(0);
      SlicePlane slicePlane1 = new SlicePlane(startSlicePlaneend1
          .getSketch().clone(), new Plane(new Vec3D(0, 0,
          (startSlicePlaneend1.getPlane().z)
              - SETTINGS.chair_slat_end_size),
          new Vec3D(0, 0, -1)));
     
      slicePlane1.destroy();//a bit of a hack make sure that our temp slice is deleted later
     
      slicePlane1.getSketch().removeLegs(); // remove any leg shapes
      slicePlane1.getSketch().build();
      planesToSlice.add(0, slicePlane1);
      // Add fake profiles on the ends
      SlicePlane startSlicePlaneend2 = planesToSlice.get(planesToSlice
          .size() - 1);
      SlicePlane slicePlane2 = new SlicePlane(startSlicePlaneend2
          .getSketch().clone(), new Plane(new Vec3D(0, 0,
          (startSlicePlaneend2.getPlane().z)
              + SETTINGS.chair_slat_end_size),
          new Vec3D(0, 0, -1)));
      slicePlane2.destroy();//a bit of a hack make sure that our temp slice is deleted later

      slicePlane2.getSketch().removeLegs(); // remove any leg shapes
      slicePlane2.getSketch().build();
      planesToSlice.add(slicePlane2);
    }

    // Add fake profiles on the ends

    float step = crossSliceSelection.spacing / guideSpline.getlength();
    float start = Math.min(crossSliceSelection.start,
        crossSliceSelection.end);
    float end = Math
        .max(crossSliceSelection.start, crossSliceSelection.end);

    if (SETTINGS.DEBUG)
      guideSpline.debugPercent = start;

    //Clear dubugging info off planes
    if (SETTINGS.DEBUG) {
      for (int j = 0; j < planesToSlice.size(); j++) {
        SlicePlane currentPlaneY = planesToSlice.get(j);
        currentPlaneY.debugIntersectionPoints.clear();
        currentPlaneY.debugIntersectionPointsTop.clear();
        currentPlaneY.debugIntersectionPointsBottom.clear();
      }
    }

    /*
     *  Step though the spline to slice
     *                     
     * <pre>                    
     *           
     *            start      
     *             /|/|/|/|/|
     *      0.1f -----------< --- (crossSliceSelection)
     *           / / / / /
     *    0.2f -----------<
     *         / / / / /
     *  0.3f -----------<
     *       |/|/|/|/|/
     *       end
     * 
     *  </pre>
     */
    for (float i = start; i <= end; i += step) {

      if (guideSpline == null || i > 1)
        return;
      Vec2D sPos = guideSpline.getPos(i);
      if(sPos == null)
        return;
     
      Vec3D vecPos = new Vec3D(sPos.x,
          sPos.y, 0);
      Vec3D vecDir = new Vec3D(guideSpline.getPerpendicular(i).x,
          guideSpline.getPerpendicular(i).y, 0);
      vecDir = vecDir.rotateZ(crossSliceSelection.offsetRotation);
      //vecDir = vecDir.rotateZ((float) (Math.PI ));
      // do we want to add a strengthening beam to the leg
      if (crossSliceSelection.tieToLeg) {
        SketchPoint point1 = (SketchPoint) guideSpline.get(0);
        SketchPoint point2 = (SketchPoint) guideSpline.get(1);
        Vec2D dir2D = point1.sub(point2).normalize();
        dir2D.rotate((float) (Math.PI / 2));
        vecPos = new Vec3D(point1.x, point1.y, 0);
        vecDir = new Vec3D(dir2D.x, dir2D.y, 0);
      }

      SlicePlane slicePlane = new SlicePlane(new Plane(vecPos, vecDir));
      slicePlane.setCrossSliceSelection(crossSliceSelection);

      //slicePlane.getPlane().normal.rotateZ((float) -(Math.PI/2));
      SketchPath topLine = new SketchPath(null);
      SketchPath bottomLine = new SketchPath(null);
View Full Code Here

Examples of toxi.geom.Plane

          float xmlNX = Float.valueOf(child.getAttributeValue("nx"));
          float xmlNY = Float.valueOf(child.getAttributeValue("ny"));
          float xmlNZ = Float.valueOf(child.getAttributeValue("nz"));

          Plane pl = new Plane(new Vec3D(xmlX, xmlY, xmlZ),
              new Vec3D(xmlNX, xmlNY, xmlNZ));
          this.setPlane(pl);
        } else {
          LOGGER.warning("requred data not found in XML file");
          return;
        }
      }

    }

    if (this.getPlane() == null) {
      this.setPlane(new Plane());
      LOGGER.warning("no Plane def found in XML making a defaul plane");

    }

  }
View Full Code Here

Examples of toxi.geom.Plane

  @Override
  public SlicePlane clone() {
    SlicePlane copiedPlane = new SlicePlane(
        this.getSketch().clone(),
        new Plane(this.getPlane().copy(), this.getPlane().normal.copy()));
    return copiedPlane;
  }
View Full Code Here

Examples of toxi.geom.Plane

        new Plane(this.getPlane().copy(), this.getPlane().normal.copy()));
    return copiedPlane;
  }

  public SlicePlane copy() {
    SlicePlane newSlicePlane = new SlicePlane(new Plane(this.plane.copy(),
        this.plane.normal.copy()));
    newSlicePlane.guide = this.guide;
    newSlicePlane.setSketch(this.getSketch().copy());
    newSlicePlane.selected = this.selected;
    newSlicePlane.getSketch().setOnSketchPlane(newSlicePlane);
View Full Code Here

Examples of vash.Plane

    float y = (float)this.center.getY();
    float[] X = ip.getXValues();
    float[] Y = ip.getYValues();
    float w = ip.getW();
    float h = ip.getH();
    Plane out = ip.getPlane();
   
    for(int j = 0; j < h; j++) {
      y0 = Y[j] - y;
      for(int i = 0; i < w; i++) {
        x0 = X[i] - x;
View Full Code Here

Examples of vash.Plane

  @Override
  public Plane compute(ImageParameters ip) {
    float freq = (float)this.frequency.getV();
    float phase = (float)this.phase.getV();
    Plane A = _children[0].compute(ip);
    Plane out = ip.getPlane();
      for(int j = 0; j < ip.getH(); j++ ) {
      for(int i = 0; i < ip.getW(); i++) {
        float denom = A.data[i][j] * freq + phase;
        if(denom == 0.0f)
          out.data[i][j] = 1.0f;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.