none
unspecified width and height in presetShapeGeometries.xml RRS feed

  • Question

  • Hi,

     

    I am moving this out of the previous thread.

    I take an example to explain my doubt...

    The following is selectively taken from the presetShapeDefinition.xml for : flowChartMagneticTape

      <gd name = "ang1" fmla = "at2 w h"/>
    
    
      <path>
        <moveTo>
         <pt x = "hc" y = "b"/>
        </moveTo>
        <arcTo
         wR = "wd2"
         hR = "hd2"
         stAng = "cd4"
         swAng = "cd4"/>
        <arcTo
         wR = "wd2"
         hR = "hd2"
         stAng = "cd2"
         swAng = "cd4"/>
        <arcTo
         wR = "wd2"
         hR = "hd2"
         stAng = "3cd4"
         swAng = "cd4"/>
        <arcTo
         wR = "wd2"
         hR = "hd2"
         stAng = "0"
         swAng = "ang1"/>
        <lnTo>
         <pt x = "r" y = "ib"/>
        </lnTo>
        <lnTo>
         <pt x = "r" y = "b"/>
        </lnTo>
        <close/>
       </path>

    if you look at this path its goes something like this...

      moves to (hc,b)            
      arc to (0,vc)               (since arc's a,b are wd2,hd2)
      arc to (hc,0)
      arc to(r,vc)

    Now the path traverses an swingAngle of ang1 which is arctan(h/w) according to the guide value. This implies that the swingAngle will change with the width, height of the shape drawn. Its easy to see that the shape is proper only when swingAngle=45degree => (w should be equal to h all the time).

    My slide xml has the following

    This is what is present on the slide

        <p:spPr>
         <a:xfrm>
          <a:off x = "0" y = "0"/>
          <a:ext cx = "1828800" cy = "914400"/>
         </a:xfrm>
         <a:prstGeom prst = "flowChartMagneticTape">
          <a:avLst/>
         </a:prstGeom>
        </p:spPr>


    Here w=2 and h=1

    Now my question is what is the w and h that we need to take to draw the shape. Should we always take them equal and later scale it w.r.t. cx , cy ?

     Hope that this example explains whats confusing me ?

    --

    Manoj

    • Edited by commando_dhruv Monday, January 31, 2011 12:33 PM formatting problem...
    Monday, January 31, 2011 12:32 PM

Answers

  • For the benefit of the other forum readers, this was resolved offline.  Manoj informed me that he discovered an error in his code that was giving incorrect results. 

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    • Marked as answer by Tom Jebo MSFT Wednesday, July 6, 2011 1:41 PM
    Wednesday, July 6, 2011 1:38 PM

All replies

  • Hi,

    Also for "moon" preset shape the arcs are drawn properly only when width:height ratio considered is 1:2.

    If not I get incorrect shape.

    --

    Manoj

    Monday, January 31, 2011 12:37 PM
  • Hi Manoj,

    I'll get back to you shortly after I've had a chance to review this.  There have been some other similar issues with presetShapeDefinition.xml

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Monday, January 31, 2011 1:42 PM
  • Hi Manoj,

    The Office team provided this explanation of width and height based on your description:

    You should draw the shape using the height and width from the extents, the formulas in the geometry are designed to account for non-square bounding boxes and adjust accordingly. You shouldn’t have to do any scaling after the fact.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Friday, February 4, 2011 4:34 AM

  • Hi Tom,

    Thanks for looking into this.

    This is exactly what I am doing. This would mean that there are multiple places where the presetShapeDefinitions.xml is incorrect. There are many shapes that have issues.

    I just ran my algorithm on the entire set of auto-shapes with varying adjust values ( obviously not all possible cases would be covered ), the following shapes have problem

       1. Cloud ( the main cloud path is ok, the remaining ones which cut inside the fills are translated incorrectly)
       2. Moon ( works well only when path h:w = 2:1)
       3. flowChartMagneticTape ( explained in the post above: the last guide should be  <gd name = "ang1" fmla = "at2 1 1"/>
       4. Block Arc ( the inner arc starts from wrong place )
       5. gear
       6. funnel ( if you use edit points and move even 1 point it works fine )

     

    Isn't office too supposed to use these XML ?  If yes, can we get the latest XML  :-).

    Cheers!!

    Manoj

    Friday, February 4, 2011 3:55 PM
  • Manoj,

    Can you please send an email to dochelp at microsoft.com, referencing the URL for this thread and my name?  I would like to take this up in email directly.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Friday, February 4, 2011 9:07 PM
  • For the benefit of the other forum readers, this was resolved offline.  Manoj informed me that he discovered an error in his code that was giving incorrect results. 

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    • Marked as answer by Tom Jebo MSFT Wednesday, July 6, 2011 1:41 PM
    Wednesday, July 6, 2011 1:38 PM