예제 #1
0
        private Polygon GetCylinderSideView()
        {
            double _offset_rad = Conversions.DegToRad(this.tilt_deg);
            double _cosOffset  = Math.Cos(_offset_rad);


            double _TDC = (_cosOffset * GetPhysicalHeightAbovePiston_mm(0));
            double _BDC = (_cosOffset * GetPhysicalHeightUnderPiston_mm(Stroke.StrokeDuration_deg));

            double _rX = Bore_mm / 2;
            double _rY = (Math.Abs(Math.Sin(_offset_rad) * _rX));

            double _rTilt = _rX * Math.Sin(Conversions.DegToRad(this.tilt_deg));

            Polygon _polygon = Polygon.Line(
                -_rX + offset_mm,
                _BDC,
                -_rX + offset_mm,
                _TDC);

            _polygon.Add(Polygon.Arc(offset_mm, _TDC, _rX, _rTilt, 0, 540, PRECISION));

            _polygon.Add(Polygon.Line(
                             _rX + offset_mm,
                             _TDC,
                             _rX + offset_mm,
                             _BDC));

            _polygon.Add(Polygon.Arc(offset_mm, _BDC, _rX, _rTilt, 180, 540, PRECISION));


            return(_polygon);
        }
예제 #2
0
        protected override Polygon GetPistonView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg)
        {
            double _cylinderRelativeCrankThrowRotation_deg = _positionedCylinder.GetCylinderRelativeCrankThrowRotation_deg(_crankshaftRotation_deg);
            double _offset_rad = Conversions.DegToRad(_positionedCylinder.Tilt_deg);
            double _cosOffset  = Math.Cos(_offset_rad);


            double _TDC = (_cosOffset * _positionedCylinder.GetPhysicalHeightAbovePiston_mm(_cylinderRelativeCrankThrowRotation_deg));
            double _BDC = (_cosOffset * _positionedCylinder.GetPhysicalHeightUnderPiston_mm(_cylinderRelativeCrankThrowRotation_deg));

            double _rX = _positionedCylinder.Bore_mm / 2d * EngineDesigner.Media.Properties.Settings.Default.PistonVsCylinderClearance;
            double _rY = (Math.Abs(Math.Sin(_offset_rad) * _rX));

            double _rTilt = _rX * Math.Sin(Conversions.DegToRad(_positionedCylinder.Tilt_deg));


            Polygon _polygon = Polygon.Line(
                -_rX + _positionedCylinder.Offset_mm,
                _BDC,
                -_rX + _positionedCylinder.Offset_mm,
                _TDC);

            _polygon.Add(Polygon.Arc(_positionedCylinder.Offset_mm, _TDC, _rX, _rTilt, 0, 540, EngineDesigner.Media.Properties.Settings.Default.BasicEngineSketchArcPrecision));

            _polygon.Add(Polygon.Line(
                             _rX + _positionedCylinder.Offset_mm,
                             _TDC,
                             _rX + _positionedCylinder.Offset_mm,
                             _BDC));

            _polygon.Add(Polygon.Arc(_positionedCylinder.Offset_mm, _BDC, _rX, _rTilt, 180, 540, EngineDesigner.Media.Properties.Settings.Default.BasicEngineSketchArcPrecision));


            return(_polygon);
        }