×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Offset a curve that is not on a planar surface (NX 8)

Offset a curve that is not on a planar surface (NX 8)

Offset a curve that is not on a planar surface (NX 8)

(OP)
I am working in NX8. I have a curve that I would like to OFFSET, making it larger in diameter so to speak. I dont see an easy way to do this using the Offset Curve function, can this be done? I have attached my file for reference and would really appreciate some advice on a quick way of doing this, thank you in advance.

RE: Offset a curve that is not on a planar surface (NX 8)

Here's a little workaround.
I extruded the spline , then offsetted the face. I first created two lines roughly across the spline, then a third line perpendicular to one of the lines to get a "reasonable" vector for the extrusion.


Regards,
Tomas

RE: Offset a curve that is not on a planar surface (NX 8)

I do not have NX8, so I am just guessing here
Is it possible to scale the curve ? then for the scale factor use sizes of new diameter/current diameter

RE: Offset a curve that is not on a planar surface (NX 8)

(OP)
You can scale it, however it moves off location of where it currently needs to be. There must be a way around that as well. Im just kind of confused why the Offset Curve function doesnt easily do this simple operation. Toost, good idea as well. Good input guys.

RE: Offset a curve that is not on a planar surface (NX 8)

It isn't really a simple operation since an offset needs a vector , if a curve is planar then the vectors are all in the plane of the curve, ( perpendicular to the curve itself) but if the curve is 3D then there is no logical default direction, there is no "plane of curve" to use.
If one scales the curve one needs to define a scale center, which one might be able to set by human logic but i doubt that a computer might "understand where it should be per default". Plus that it will scale in all directions not only in the "expected plane of curve" ( The scaled curve will also be "higher" .)
My workaround is based upon my assumption of the extrusion vector, then the offset is the face normal.

I attach a picture for Jerry.

Regards,
Tomas

RE: Offset a curve that is not on a planar surface (NX 8)

Another NX8 guees here . . . because I don't have it.
Under previous versions of NX there was 3 Point Fit and 4 Point Fit under Transform
There must be something eqivalent to that in NX8.
Maybe use the binoculars and enter 3 Point Fit and see what comes up

RE: Offset a curve that is not on a planar surface (NX 8)

It depends on how you want to offset. I have used the z axis as the normal direction. That is at each point on the original spline I determine a vector offset using the cross product of the spline slope with the normal. Below is the journal. Just change the line

Dim offset1 As Double = 0.5

to some other value. Note this journal only works using NX8.

CODE -->

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Features

Module ZNormalOffset
    Dim s As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim workPart As Part = s.Parts.Work
    Sub Main()
        Dim offset1 As Double = 0.5
        Dim spline1 As Spline = Nothing
        spline1 = select_a_spline("Select a Spline")
        Dim curveparm As Double = 0.0
        Dim delcurveparm As Double = 1.0 / 100.0
        Dim pnt1(2) As Double
        Dim curvetang(2) As Double
        Dim junk3(2) As Double
        Dim junk1 As Double = Nothing
        Dim normal1() As Double = {0.0, 0.0, 1.0}
        Dim vect1(2) As Double
        Dim magnitude1 As Double = 0.0001
        Dim epnt1(2) As Double
        Dim coordinates1 As Point3d
        Dim ArrayOfPoints2(99) As Point
        For i As Integer = 0 To 99
            ufs.Modl.AskCurveProps(spline1.Tag, curveparm, pnt1, curvetang, junk3, junk3, junk1, junk1)
            ufs.Vec3.Cross(normal1, curvetang, vect1)
            ufs.Vec3.Unitize(vect1, 0.001, magnitude1, vect1)
            epnt1(0) = pnt1(0) + offset1 * vect1(0)
            epnt1(1) = pnt1(1) + offset1 * vect1(1)
            epnt1(2) = pnt1(2) + offset1 * vect1(2)
            coordinates1 = New Point3d(epnt1(0), epnt1(1), epnt1(2))
            ArrayOfPoints2(i) = workPart.Points.CreatePoint(coordinates1)
            curveparm += delcurveparm
        Next
        Dim splinefeat2 As Feature
        Dim periodic1 As Boolean = True
        splinefeat2 = CreateStudioSplineThruPoints(ArrayOfPoints2, periodic1)
    End Sub
    
    Public Function CreateStudioSplineThruPoints(ByRef points() As Point, ByVal periodic1 As Boolean) As Feature
        Dim markId9 As Session.UndoMarkId
        markId9 = s.SetUndoMark(Session.MarkVisibility.Visible, "Studio Spline Thru Point")
        Dim Pcount As Integer = points.Length - 1
        Dim nullNXObject As NXObject = Nothing
        Dim studioSplineBuilderEx1 As Features.StudioSplineBuilderEx
        studioSplineBuilderEx1 = workPart.Features.CreateStudioSplineBuilderEx(nullNXObject)
        studioSplineBuilderEx1.Degree = 3
        studioSplineBuilderEx1.InputCurveOption = StudioSplineBuilderEx.InputCurveOptions.Delete
        studioSplineBuilderEx1.Type = Features.StudioSplineBuilderEx.Types.ThroughPoints
        studioSplineBuilderEx1.IsPeriodic = periodic1
        studioSplineBuilderEx1.MatchKnotsType = Features.StudioSplineBuilderEx.MatchKnotsTypes.None
        studioSplineBuilderEx1.HasPlaneConstraint = False
        studioSplineBuilderEx1.OrientExpress.AxisOption = GeometricUtilities.OrientXpressBuilder.Axis.Passive
        studioSplineBuilderEx1.OrientExpress.PlaneOption = GeometricUtilities.OrientXpressBuilder.Plane.Passive
        Dim knots1(-1) As Double
        studioSplineBuilderEx1.SetKnots(knots1)
        Dim parameters1(-1) As Double
        studioSplineBuilderEx1.SetParameters(parameters1)
        Dim nullDirection As Direction = Nothing
        Dim nullScalar As Scalar = Nothing
        Dim nullOffset As Offset = Nothing
        Dim geometricConstraintData(Pcount) As Features.GeometricConstraintData
        For ii As Integer = 0 To Pcount
            geometricConstraintData(ii) = studioSplineBuilderEx1.ConstraintManager.CreateGeometricConstraintData()
            geometricConstraintData(ii).Point = points(ii)
            geometricConstraintData(ii).AutomaticConstraintDirection = Features.GeometricConstraintData.ParameterDirection.Iso
            geometricConstraintData(ii).AutomaticConstraintType = Features.GeometricConstraintData.AutoConstraintType.None
            geometricConstraintData(ii).TangentDirection = nullDirection
            geometricConstraintData(ii).TangentMagnitude = nullScalar
            geometricConstraintData(ii).Curvature = nullOffset
            geometricConstraintData(ii).CurvatureDerivative = nullOffset
            geometricConstraintData(ii).HasSymmetricModelingConstraint = False
        Next ii
        studioSplineBuilderEx1.ConstraintManager.SetContents(geometricConstraintData)
        Dim feature1 As Features.Feature
        feature1 = studioSplineBuilderEx1.CommitFeature()
        studioSplineBuilderEx1.Destroy()
        Return feature1
    End Function
    Function select_a_spline(ByVal prompt As String) As Spline
        Dim ui As UI = ui.GetUI()
        Dim curveType() As Selection.SelectionType = _
            {Selection.SelectionType.Curves}
        Dim cursor As Point3d = Nothing
        Dim selobj As Spline = Nothing
        Dim resp As Selection.Response = _
            ui.SelectionManager.SelectObject("Select a spline", prompt, _
                Selection.SelectionScope.AnyInAssembly, False, _
                curveType, selobj, cursor)
        Return selobj
    End Function
    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
    End Function
End Module 

Frank Swinkels

RE: Offset a curve that is not on a planar surface (NX 8)

This solution is a bit kludgy, but might give you what you want.

1) Use N-sided surface with triangular type to Build a surface of the spline.
2) Enlarge the faces in UV directions with linear mode.
3) Sew the enlarged faces together.
2) Use the Offset curve in face command with the sewn faces and original spline. Set the offset method to along arc length.

Step 1 to 3, is the kludge bit as the quality of the created surfaces will decide the final offset curves position.

RE: Offset a curve that is not on a planar surface (NX 8)

I used the same approach as petulf,
Use N-sided surface with triangular type to Build a surface of the spline
copied the spline, splited the copy in 4 segments , offset in face with the segments
regards

RE: Offset a curve that is not on a planar surface (NX 8)

Project the curves to a plane that is parallel to the direction you want to offset, then offset the curves, then project back on to the face the curves were on, if no face you may have to make an n-sided surface beforehand to be able to project them back to.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources