protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);

            obj["ExtrudedDirection"] = ExtrudedDirection.getJson(this, options);
            obj["Depth"]             = mDepth;
        }
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);

            obj["ExtrudedDirection"] = ExtrudedDirection.getJson(this, processed);
            obj["Depth"]             = mDepth;
        }
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(SweptArea != null ? SweptArea.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(ExtrudedDirection != null ? ExtrudedDirection.ToStepValue() : "$");
            parameters.Add(Depth != null ? Depth.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
 internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary <string, XmlElement> processed)
 {
     base.SetXML(xml, host, processed);
     xml.AppendChild(ExtrudedDirection.GetXML(xml.OwnerDocument, "ExtrudedDirection", this, processed));
     xml.SetAttribute("Depth", mDepth.ToString());
 }
Beispiel #5
0
        /// <summary>
        /// Returns the surface which defines the internal shape of the face
        /// </summary>
        /// <param name="lcs">The local coordinate system for the surface.  Can be null.</param>
        /// <returns>The surface which defines the internal shape of the face</returns>
        public override Surface GetSurface(Transform lcs)
        {
            Curve sweptCurve = null;

            // Get the RuledSurface which is used to create the geometry from the brepbuilder
            if (!(SweptCurve is IFCSimpleProfile))
            {
                return(null);
            }
            else
            {
                // Currently there is no easy way to get the curve from the IFCProfile, so for now we assume that
                // the SweptCurve is an IFCSimpleProfile and its outer curve only contains one curve, which is the
                // profile curve that we want
                IFCSimpleProfile simpleSweptCurve = SweptCurve as IFCSimpleProfile;
                CurveLoop        outerCurve       = simpleSweptCurve.OuterCurve;
                if (outerCurve == null)
                {
                    return(null);
                }
                CurveLoopIterator it = outerCurve.GetCurveLoopIterator();
                sweptCurve = it.Current;
            }
            // Position/transform the Curve first according to the lcs of the IfcSurfaceOfLinearExtrusion
            sweptCurve = sweptCurve.CreateTransformed(Position);

            // Create the second profile curve by translating the first one in the extrusion direction
            Curve profileCurve2 = sweptCurve.CreateTransformed(Transform.CreateTranslation(ExtrudedDirection.Multiply(Depth)));

            if (lcs == null)
            {
                return(RuledSurface.Create(sweptCurve, profileCurve2));
            }

            Curve transformedProfileCurve1 = sweptCurve.CreateTransformed(lcs);
            Curve transformedProfileCurve2 = profileCurve2.CreateTransformed(lcs);

            return(RuledSurface.Create(transformedProfileCurve1, transformedProfileCurve2));
        }