Announcement

Collapse
No announcement yet.

Draw curves on image base on OIV

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Draw curves on image base on OIV

    I use OIV draw curves on image. I want to achieve interactive curve drawing . Now I try to
    use SoNurbsCurve to achive it.
    The parameters of SoNurbsCurve are knotVector 、controlPoints and Order. But they are not the curve 's point on itself(curve). My question is: How to Realize Interactive Curve Drawing? When user click on the Screen to get SoPickedPoint by using mousebuttonEvent, the point is on the curve,not controls Trend of Curve. Maybe the method of drawing curve is false, if you have the better method, please let me know.

  • #2
    Originally posted by OIV_Ting View Post
    I use OIV draw curves on image. I want to achieve interactive curve drawing . Now I try to use SoNurbsCurve to achive it. The parameters of SoNurbsCurve are knotVector 、controlPoints and Order. But they are not the curve 's point on itself(curve). My question is: How to Realize Interactive Curve Drawing? When user click on the Screen to get SoPickedPoint by using mousebuttonEvent, the point is on the curve,not controls Trend of Curve. Maybe the method of drawing curve is false, if you have the better method, please let me know.
    Hi,
    You are on the right track, looking for a spline curve. There are several ways to compute/display a spline curve in Open Inventor. SoNurbsCurve is the most general/powerful and PoCurve is perhaps the most convenient. However, neither of these classes generates an "interpolating spline" that passes through the points of the input curve (control points).

    Another solution is the ImageViz class SoPolylineResamplerApproximation3d. This class can compute a Catmull-Rom spline curve that interpolates (passes through) the points of the input curve. This type of class is called an "engine". It does computation, but does not display the results. The resulting spline curve coordinates can be displayed using a standard SoLineSet node.

    I have attached a simple example program that shows how an application can allow the user to interactively select points on the "input" curve (using SoPolygonScreenDrawer) and also display the corresponding spline curve. Note that this example is focused on a specific task. It does not show how to edit the points on the input curve, only how to compute and display the spline curve as the input points are selected.
    InterpolatingSpline.zip
    Good luck with your project.
    Mike
    Last edited by mikeheck; April 8th, 2019, 10:55 PM.

    Comment


    • #3
      Thanks a lot! But I can not download your document, could you send to my email? My email address is "[email protected]"! Thank you !

      Comment


      • #4
        Originally posted by OIV_Ting View Post
        Thanks a lot! But I can not download your document, could you send to my email? My email address is "[email protected]"! Thank you !
        Hi, I tried to email you at that address, but it failed with a "550: User not found". Please check that it's correct.
        -Mike

        Comment


        • #5
          HiCI am so sorry that the address is fault. Please send to the address "[email protected]". Thanks a lot I

          Comment


          • #6
            Hi, I cannot use the class
            SoPolylineResamplerApproximation3d. Is there other method to make it come true ?

            Comment


            • #7
              Originally posted by OIV_Ting View Post
              Hi, I cannot use the class
              SoPolylineResamplerApproximation3d. Is there other method to make it come true ?
              OK, I see that class is not (yet) included in the Open Inventor .NET API. We'll fix that, but it may take a little time.
              For now... here is a .NET version of the example program with the curve computation as a simple utility class. I will also send it to your email address.
              InterpolatingSpline.NET.zip
              Regards,
              Mike
              Attached Files
              Last edited by mikeheck; April 12th, 2019, 09:59 PM.

              Comment

              Working...
              X