Exemple #1
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Feature(Sketch sketch) : this()
		{
			this.Sketch = sketch;
			
			// Copy the working momento back to the first momento to take into account 
			// the sketch. This has to be done becuase the Entity constructor sets the first 
			// momento but we want the sketch to be included.
			momentos[0]["Sketch"] = sketch;
		}
Exemple #2
0
		/// <summary>
		/// Create the extrusion.
		/// </summary>
		protected void CreateExtrusion()
		{		
			
			// create the sketch
			Sketch extSketch = new Sketch(ZPlane);			
			AddSketch(extSketch);
			
			// add the line
			Point p1 = new Point(1.0, -1.0, 0.0);
			Point p2 = new Point(-1.0, -1.0, 0.0);
			Point p3 = new Point(-1.0, 1.0, 0.0);
			new Line(extSketch, p1, p2);
			
			// add the arc
			new Arc(extSketch, p2, p3, Angle.Pi()/-2.0);
			
			// add the extrusion
			Extrusion ext1 = new Extrusion(extSketch) {Name = "TestExtrusion"};
			ext1.Path = refLine;
			ext1.Travel = new Length(1.0);
			ext1.Snapshot();
			
			AddFeature(ext1);
		}
		public BoxedSketchable(Sketch sketch)
			: base(sketch)
		{

			Anchor2 = null;
		}
Exemple #4
0
		public Rectangle(Sketch sketch) : base(sketch)
		{
			solidPoints = new Vector[5]; // needs to come back on itself
			directions = new Vector[5];
			wireframePoints = new Vector[4]; // just the corners
		}
Exemple #5
0
		/// <summary>
		/// Constructor that initializes the sketch.
		/// </summary>
		/// <param name="sketch"> A <see cref="Sketch"/> to extrude. </param>
		public Extrusion(Sketch sketch) : this()
		{
			Sketch = sketch;
		}
Exemple #6
0
		public Sketchable(Sketch sketch) : this()
		{
			Sketch = sketch;
		}
Exemple #7
0
		/// <summary>
		/// Initialization constructor.
		/// Sets the values of the first two points.
		/// </summary>
		/// <param name="sketch">The sketch.</param>
		/// <param name="p1"> The first <see cref="Point"/>. </param>
		/// <param name="p2"> The second <see cref="Point"/>. </param>
		public Line(Sketch sketch, Point p1, Point p2) : this(sketch)
		{
			Points.Add(p1);
			Points.Add(p2);
		}
Exemple #8
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Line(Sketch sketch) : this()
		{
			Sketch = sketch;
		}
Exemple #9
0
		/// <summary>
		/// Creates the revolution.
		/// </summary>
		protected void CreateRevolution()
		{
			// create the sketch
			Sketch revolutionSketch = new Sketch(XPlane);
			AddSketch(revolutionSketch);
			
			// add the line
			Point bottom = new Point(0.0, 1.0, 1.5);
			Point top = new Point(0.0, 1.0, 2.5);
			Point middle = new Point(0.0, 1.0, 2.0);
			Line line2 = new Line(revolutionSketch, bottom, top);
			line2.Points.Add(new Point(0.0, 1.25, 2.5));
			line2.Points.Add(new Point(0.0, 1.25, 2.0));
			line2.Points.Add(new Point(0.0, 1.5, 2.0));
			
			// add the arc			
			new Arc(revolutionSketch, middle, bottom, Angle.Pi() / 2);
			
			// create the revolution
			Revolution revolution1 = new Revolution(revolutionSketch) { Name = "TestRevolution" };
			revolution1.Axis = refLine;
			revolution1.Travel = Angle.Pi()*-1;
			revolution1.Snapshot();
			AddFeature( revolution1);
		}
Exemple #10
0
		/// <summary>
		/// Constructor that initializes the sketch.
		/// </summary>
		/// <param name="sketch"> A <see cref="Sketch"/> to extrude. </param>
		public Revolution(Sketch sketch) : this()
		{
			Sketch = sketch;
		}
Exemple #11
0
		/// <summary>
		/// Initialization constructor.
		/// </summary>
		/// <param name="sketch">The sketch.</param>
		/// <param name="center"> The center. </param>
		/// <param name="start"> The starting point. </param>
		/// <param name="sweep"> The sweep angle. </param>
		public Arc(Sketch sketch, Point center, Point start, Angle sweep) : base(sketch)
		{
			Center = center;
			Start = start;
			Sweep = sweep;
		}
Exemple #12
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Arc(Sketch sketch) : this(sketch, null, null, new Angle())
		{
		}
Exemple #13
0
		public Spline(Sketch sketch)
			: base(sketch)
		{

		}
Exemple #14
0
		public Ellipse(Sketch sketch)
			: base(sketch)
		{
			wireframePoints = new Vector[4];
		}