Loading ...
Sorry, an error occurred while loading the content.

CC2 File format question

Expand Messages
  • sparrowhawk00001
    Im currently writing a program to read the CC2 file format, and i have a question for those who might be familier with the Path2 Structure; typedef struct {
    Message 1 of 5 , Jun 20, 2002
    • 0 Attachment
      Im currently writing a program to read the CC2 file format, and i
      have a question for those who might be familier with the Path2
      Structure;

      typedef struct
      {
      char SmType;
      char SRes;
      float SParm;
      float EParm;
      short Count;
      char Flags;
      char unused;
      GPOINT2 Nodes[];
      } GPATH2;

      // Values for Smoother Flags
      #define SM_NO 0 // no smoothing
      #define SM_CB 1 // Cubic B-Spline (as in FastCAD 2.x)
      #define SM_PB 2 // Parabolic Blend (through-point)
      #define SM_BZ 3 // Bezier

      Now i have some dumb questions.... :)
      1. What is a "Cubic B-Spline"
      2. What is a "Parabolic Blend"
      3. How does the SRes member work?

      Daniel Pickett
      Sparrowhawk@...
    • Mike Riddle
      The SRes value is one of the SM_ constants. SM_NO draws a normal path. The otehr draw smoothed curves defined by the node points. SM_CB draws a cubic B-Spline,
      Message 2 of 5 , Jun 20, 2002
      • 0 Attachment
        The SRes value is one of the SM_ constants. SM_NO draws a normal path.
        The otehr draw smoothed curves defined by the node points. SM_CB draws
        a cubic B-Spline, which starts at the first node, ends at the last, but
        does not
        go through the other points - rather they make a frame into which a smoothed
        curve is fit. This is a good curve with 2d order continuity. The SM_PB makes
        a parabolic spline, which is a smooth curve through each of the points,
        but this
        curve may make fairly unexpected deviations in order to go through the
        points
        smoothly.

        A bezier curve must have 3 or 4 nodes only. The first and last define
        the endpoints,
        and the other tow points pull the shape of the curve in a similar manner
        to the
        cubic b-spline. Bezier curves are faster to calculate and draw than
        cubic b-splines.

        You might check out a book on computer graphics for more information on
        smoothed curves if you want a better definition, such as the classic
        "Computer Graphics"
        by Foley/Van Dam/Feiner/Hughes from Addison Wesley. However, what you also
        might do is to make a path of 4 nodes, and try setting SRes to all 4
        values and see
        the result - especially useful is to make one with SM_NO and another of the
        curves with a different SMRes value but the same nodes, at the same
        time. This
        will probably give you the best idea, for the least effort.


        sparrowhawk00001 wrote:

        >Im currently writing a program to read the CC2 file format, and i
        >have a question for those who might be familier with the Path2
        >Structure;
        >
        >typedef struct
        >{
        > char SmType;
        > char SRes;
        > float SParm;
        > float EParm;
        > short Count;
        > char Flags;
        > char unused;
        > GPOINT2 Nodes[];
        >} GPATH2;
        >
        >// Values for Smoother Flags
        >#define SM_NO 0 // no smoothing
        >#define SM_CB 1 // Cubic B-Spline (as in FastCAD 2.x)
        >#define SM_PB 2 // Parabolic Blend (through-point)
        >#define SM_BZ 3 // Bezier
        >
        >Now i have some dumb questions.... :)
        >1. What is a "Cubic B-Spline"
        >2. What is a "Parabolic Blend"
        >3. How does the SRes member work?
        >
        >Daniel Pickett
        >Sparrowhawk@...
        >
        >
        >
        >To Post a message, send it to: cc2-dev-l@...
        >To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
        >
        >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >
        >
      • Peter Olsson
        ... SmType is the type of smoothing, SM_NO, SM_CB, etc... I don t think SRes is used at all. The default value is 8, but I think it is there only for
        Message 3 of 5 , Jun 21, 2002
        • 0 Attachment
          > 3. How does the SRes member work?

          SmType is the type of smoothing, SM_NO, SM_CB, etc...

          I don't think SRes is used at all. The default value is 8, but I think it is
          there only for historical reasons. At least I have not been able to see any
          difference when changing this value.

          SParm and EParm are the path "T"-values for start- and endpoint. This is
          used to trim smoothed objects. They keep all their nodes during a trim and
          just set start and end parameters. It is not the true T-value (normally
          between 0 and 1). The integer part is used to tell between what nodes the
          point is. For new objects set SParm=0 and EParm=Count-1 for paths and
          EParm=Count for polygons.

          Count is number of nodes.

          Flags is assigned NL_CLS for polygons (closed object), otherwise 0.


          Peter Olsson
        • Joe Slayton
          Isn t SRes the number of points interpolated between each node? You wouldn t see a difference unless you re zoomed way in. I seem to recall that setting it
          Message 4 of 5 , Jun 21, 2002
          • 0 Attachment
            Isn't SRes the number of points interpolated between each node? You
            wouldn't see a difference unless you're zoomed way in. I seem to recall
            that setting it higher resulted in slower redraws in an earlier version.

            Joe Slayton

            Peter Olsson wrote:
            >
            > > 3. How does the SRes member work?
            >
            > SmType is the type of smoothing, SM_NO, SM_CB, etc...
            >
            > I don't think SRes is used at all. The default value is 8, but I think it is
            > there only for historical reasons. At least I have not been able to see any
            > difference when changing this value.
          • Mike Riddle
            Thanks for catching my error SRes .vs. SMType - I get blind at times... SRes is indeed the number of interpolated points between nodes in the general library
            Message 5 of 5 , Jun 21, 2002
            • 0 Attachment
              Thanks for catching my error SRes .vs. SMType - I get blind at times...
              SRes is indeed the number of interpolated points between nodes in the
              general library from which CC2 is derived, but in CC2 the value is
              ignored and should always be set to 8, the default.

              Mike

              Joe Slayton wrote:
                Isn't SRes the number of points interpolated between each node? You
              wouldn't see a difference unless you're zoomed way in. I seem to recall
              that setting it higher resulted in slower redraws in an earlier version.

              Joe Slayton

              Peter Olsson wrote:
              3. How does the SRes member work?
              SmType is the type of smoothing, SM_NO, SM_CB, etc...

              I don't think SRes is used at all. The default value is 8, but I think it is
              there only for historical reasons. At least I have not been able to see any
              difference when changing this value.

              ------------------------ Yahoo! Groups Sponsor ---------------------~-->
              Free $5 Love Reading
              Risk Free!
              http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/f.ewlB/TM
              ---------------------------------------------------------------------~->

              To Post a message, send it to: cc2-dev-l@...
              To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





            Your message has been successfully submitted and would be delivered to recipients shortly.