コード例 #1
0
ファイル: Reverse.cs プロジェクト: asmboom/forge
        public static Geometry Process(Geometry geometry)
        {
            Reverse reverse = new Reverse();

            reverse.Input = geometry;
            return(reverse.Output());
        }
コード例 #2
0
ファイル: Cylinder.cs プロジェクト: asmboom/forge
		public Geometry Output() {

			if (Segments <= 1) {
				OperatorError = "Segments must be greater than 1";
				return Geometry.Empty;
			} else {
				OperatorError = null;
			}

			var bottom = new Circle();
			bottom.Radius = Radius;
			bottom.Segments = Segments;
			bottom.Center = new Vector3(Center.x, Center.y - Height/2, Center.z);

			var top = new Circle();
			top.Radius = Radius;
			top.Segments = Segments;
			top.Center = new Vector3(Center.x, Center.y + Height/2, Center.z);

			var scaffold = new Merge(bottom.Output(), top.Output());

			var bridge = new Bridge(scaffold.Output());
			bridge.ClosePolygons = true;

			var cylinder = new Merge(bridge.Output());

			if (CapTop) {
				top.Surface = true;
				cylinder.Input.Add(top.Output());
			}

			if (CapBottom) {
				bottom.Surface = true;
				cylinder.Input.Add(Reverse.Process(bottom.Output()));
			}

			var geo = cylinder.Output();
			geo.ApplyOrientation(Orientation);
			return geo;
		}