This project is read-only.

Problem with drawing not opening

Sep 4, 2009 at 1:50 AM
Edited Sep 4, 2009 at 1:51 AM

First let me say excellent work!  I really enjoyed using the application, and I'm downloading the source now.

I am having a problem opening a file.  I created a drawing and saved the file, but when I try to open it, I just get a blank page.  I don't get any errors.  Am I doing something wrong?  Browser security settings, maybe?  I've tried it in IE and Chrome.  I'm including the drawing file below, it's a five-point egg.

Thanks!

Jason

<?xml version="1.0" encoding="utf-16"?>
<Drawing>
  <Viewport Left="-8.0064887414" Top="4.5236680219" Right="8.8723692832" Bottom="-3.5239303577" />
  <Styles>
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="1" Size="10" StrokeWidth="1" />
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="2" Size="10" StrokeWidth="1" />
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="3" Size="10" StrokeWidth="1" />
    <LineStyle Color="#FF000000" Name="4" StrokeWidth="1" />
    <ShapeStyle Color="#FF000000" Fill="#FFFFFF00" Name="5" StrokeWidth="1" />
    <TextStyle Bold="false" Color="#FF000000" FontFamily="Arial" FontSize="10" Italic="false" Name="6" />
    <TextStyle Bold="false" Color="#FF000000" FontFamily="Arial" FontSize="10" Italic="false" Name="7" />
  </Styles>
  <Figures>
    <FreePoint Name="FreePoint22" Style="1" X="0" Y="0" />
    <FreePoint Name="FreePoint84" Style="1" X="-0.6833196689" Y="0.2352297614" />
    <FreePoint Name="FreePoint93" Style="1" X="-0.7239079597" Y="3.0512604293" />
    <FreePoint Name="FreePoint94" Style="1" X="-2.051483851" Y="0.7594962081" />
    <FreePoint Name="FreePoint104" Style="1" X="0.7199519514" Y="3.0561055968" />
    <FreePoint Name="FreePoint114" Style="1" X="-1.8211629419" Y="-0.9772738699" />
    <FreePoint Name="FreePoint149" Style="1" X="-0.2539267131" Y="0.0327210852" />
    <FreePoint Name="FreePoint162" Style="1" X="0.6618099418" Y="-2.0846171065" />
    <FreePoint Name="FreePoint176" Style="1" X="0.2596610405" Y="0.0375662527" />
    <Arc Name="Arc192" Style="4">
      <Dependency Name="FreePoint32" />
      <Dependency Name="FreePoint104" />
      <Dependency Name="FreePoint93" />
    </Arc>
    <FreePoint Name="FreePoint32" Style="1" X="0" Y="2.2186990955" />
    <FreePoint Name="FreePoint103" Style="1" X="2.0475278427" Y="0.7546510406" />
    <Arc Name="Arc175" Style="4">
      <Dependency Name="FreePoint149" />
      <Dependency Name="FreePoint162" />
      <Dependency Name="FreePoint174" />
    </Arc>
    <Arc Name="Arc184" Style="4">
      <Dependency Name="FreePoint84" />
      <Dependency Name="FreePoint174" />
      <Dependency Name="FreePoint103" />
    </Arc>
    <FreePoint Name="FreePoint174" Style="1" X="1.8246501387" Y="-0.9653834171" />
    <FreePoint Name="FreePoint130" Style="1" X="0.0019910858" Y="-0.5593700625" />
    <Arc Name="Arc180" Style="4">
      <Dependency Name="FreePoint176" />
      <Dependency Name="FreePoint114" />
      <Dependency Name="FreePoint166" />
    </Arc>
    <FreePoint Name="FreePoint166" Style="1" X="-0.6560756145" Y="-2.0846171065" />
    <Arc Name="Arc163" Style="4">
      <Dependency Name="FreePoint130" />
      <Dependency Name="FreePoint161" />
      <Dependency Name="FreePoint162" />
    </Arc>
    <Arc Name="Arc171" Style="4">
      <Dependency Name="FreePoint130" />
      <Dependency Name="FreePoint166" />
      <Dependency Name="FreePoint161" />
    </Arc>
    <FreePoint Name="FreePoint161" Style="1" X="-0.0019780038" Y="-2.2202817961" />
    <Arc Name="Arc105" Style="4">
      <Dependency Name="FreePoint79" />
      <Dependency Name="FreePoint103" />
      <Dependency Name="FreePoint104" />
    </Arc>
    <FreePoint Name="FreePoint79" Style="1" X="-1.9226171107" Y="-0.0008299217" />
    <Arc Name="Arc115" Style="4">
      <Dependency Name="FreePoint82" />
      <Dependency Name="FreePoint94" />
      <Dependency Name="FreePoint114" />
    </Arc>
    <FreePoint Name="FreePoint82" Style="1" X="0.686906952" Y="0.2386102547" />
    <Arc Name="Arc95" Style="4">
      <Dependency Name="FreePoint76" />
      <Dependency Name="FreePoint93" />
      <Dependency Name="FreePoint94" />
    </Arc>
    <FreePoint Name="FreePoint76" Style="1" X="1.9198698822" Y="0.0025347779" />
  </Figures>
</Drawing>

 

 

Sep 5, 2009 at 9:10 AM

Hi Jason,

thanks for your message! It is indeed a bug in the code that was reading the XML and I've just fixed it. I've checked in a fix and also updated http://livegeometry.com. Keep in mind that it might take up to 24 hours for the change to actually appear on the server, but if you download the latest source you should be fine.

If you're curious, the bug is the following. The code relied on the fact that when reading a figure, all its dependencies are already read in and created. In your drawing, some figures are defined AFTER they're mentioned (e.g. Arc192 needs FreePoint32, but FreePoint32 is declared after Arc192). The fix actually does topological sorting on the figures so we can now read figures declared in any order. As a bonus, when you read a drawing using the new code and then save it again, it will save in the right order for you.

Here's an updated drawing that should work for you:

<?xml version="1.0" encoding="utf-16"?>
<Drawing>
  <Viewport Left="-8.0064887414" Top="4.6534436124" Right="8.8723692832" Bottom="-3.6537059482" />
  <Styles>
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="1" Size="10" StrokeWidth="1" />
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="2" Size="10" StrokeWidth="1" />
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="3" Size="10" StrokeWidth="1" />
    <LineStyle Color="#FF000000" Name="4" StrokeWidth="1" />
    <ShapeStyle Color="#FF000000" Fill="#FFFFFF00" Name="5" StrokeWidth="1" />
    <TextStyle Bold="false" Color="#FF000000" FontFamily="Arial" FontSize="10" Italic="false" Name="6" />
    <TextStyle Bold="false" Color="#FF000000" FontFamily="Arial" FontSize="10" Italic="false" Name="7" />
  </Styles>
  <Figures>
    <FreePoint Name="FreePoint22" Style="1" X="0" Y="0" />
    <FreePoint Name="FreePoint84" Style="1" X="-0.7641887661" Y="0.2683797918" />
    <FreePoint Name="FreePoint93" Style="1" X="-0.7239079597" Y="3.0512604293" />
    <FreePoint Name="FreePoint94" Style="1" X="-2.051483851" Y="0.7594962081" />
    <FreePoint Name="FreePoint104" Style="1" X="0.7199519514" Y="3.0561055968" />
    <FreePoint Name="FreePoint114" Style="1" X="-1.8211629419" Y="-0.9772738699" />
    <FreePoint Name="FreePoint149" Style="1" X="-0.2539267131" Y="0.0327210852" />
    <FreePoint Name="FreePoint162" Style="1" X="0.6618099418" Y="-2.0846171065" />
    <FreePoint Name="FreePoint176" Style="1" X="0.2596610405" Y="0.0375662527" />
    <FreePoint Name="FreePoint32" Style="1" X="0.0030320532" Y="2.4377627981" />
    <Arc Name="Arc192" Style="4">
      <Dependency Name="FreePoint32" />
      <Dependency Name="FreePoint104" />
      <Dependency Name="FreePoint93" />
    </Arc>
    <FreePoint Name="FreePoint103" Style="1" X="2.0475278427" Y="0.7546510406" />
    <FreePoint Name="FreePoint174" Style="1" X="1.8246501387" Y="-0.9653834171" />
    <Arc Name="Arc175" Style="4">
      <Dependency Name="FreePoint149" />
      <Dependency Name="FreePoint162" />
      <Dependency Name="FreePoint174" />
    </Arc>
    <Arc Name="Arc184" Style="4">
      <Dependency Name="FreePoint84" />
      <Dependency Name="FreePoint174" />
      <Dependency Name="FreePoint103" />
    </Arc>
    <FreePoint Name="FreePoint130" Style="1" X="0.0019910858" Y="-0.5593700625" />
    <FreePoint Name="FreePoint166" Style="1" X="-0.6560756145" Y="-2.0846171065" />
    <Arc Name="Arc180" Style="4">
      <Dependency Name="FreePoint176" />
      <Dependency Name="FreePoint114" />
      <Dependency Name="FreePoint166" />
    </Arc>
    <FreePoint Name="FreePoint161" Style="1" X="-0.0019780038" Y="-2.2202817961" />
    <Arc Name="Arc163" Style="4">
      <Dependency Name="FreePoint130" />
      <Dependency Name="FreePoint161" />
      <Dependency Name="FreePoint162" />
    </Arc>
    <Arc Name="Arc171" Style="4">
      <Dependency Name="FreePoint130" />
      <Dependency Name="FreePoint166" />
      <Dependency Name="FreePoint161" />
    </Arc>
    <FreePoint Name="FreePoint79" Style="1" X="-1.9226171107" Y="-0.0008299217" />
    <Arc Name="Arc105" Style="4">
      <Dependency Name="FreePoint79" />
      <Dependency Name="FreePoint103" />
      <Dependency Name="FreePoint104" />
    </Arc>
    <FreePoint Name="FreePoint82" Style="1" X="0.686906952" Y="0.2386102547" />
    <Arc Name="Arc115" Style="4">
      <Dependency Name="FreePoint82" />
      <Dependency Name="FreePoint94" />
      <Dependency Name="FreePoint114" />
    </Arc>
    <FreePoint Name="FreePoint76" Style="1" X="1.9198698822" Y="0.0025347779" />
    <Arc Name="Arc95" Style="4">
      <Dependency Name="FreePoint76" />
      <Dependency Name="FreePoint93" />
      <Dependency Name="FreePoint94" />
    </Arc>
  </Figures>
</Drawing>

Thanks!

Kirill

Sep 5, 2009 at 9:11 AM

Also, thanks for the interesting link and idea! I haven't heard about the 5-point-egg before and this is truly awesome! I couldn't help but recreate the drawing:

<?xml version="1.0" encoding="utf-16"?>
<Drawing>
  <Viewport Left="-13.5875" Top="7.1125" Right="18.3125" Bottom="-8.5875" />
  <Styles>
    <PointStyle Color="#FF000000" Fill="#FFFFFF00" Name="1" Size="11" StrokeWidth="1" />
    <PointStyle Color="#FF000000" Fill="#FF33FF00" Name="2" Size="10" StrokeWidth="1" />
    <PointStyle Color="#FFA97070" Fill="#FFFBFBF1" Name="3" Size="10" StrokeWidth="1" />
    <LineStyle Color="#FF000000" Name="4" StrokeWidth="1" />
    <ShapeStyle Color="#FF000000" Fill="#FFFFFF00" Name="5" StrokeWidth="1" />
    <TextStyle Bold="false" Color="#FF1053C5" FontFamily="Comic Sans MS" FontSize="28" Italic="false" Name="6" />
    <TextStyle Bold="false" Color="#FF000000" FontFamily="Comic Sans MS" FontSize="14" Italic="false" Name="7" />
    <LineStyle Color="#FFC3C0C0" Name="8" StrokeWidth="0.6" />
    <LineStyle Color="#FF2E6EED" Name="9" StrokeWidth="2" />
  </Styles>
  <Figures>
    <FreePoint Name="FreePoint13" Style="1" X="-3.925" Y="4.6" />
    <FreePoint Name="FreePoint14" Style="1" X="-1.925" Y="4.6" />
    <Segment Name="Segment15" Style="4">
      <Dependency Name="FreePoint13" />
      <Dependency Name="FreePoint14" />
    </Segment>
    <FreePoint Name="FreePoint18" Style="1" X="2.05" Y="2.225" />
    <CircleByRadius Name="CircleByRadius19" Style="8">
      <Dependency Name="FreePoint13" />
      <Dependency Name="FreePoint14" />
      <Dependency Name="FreePoint18" />
    </CircleByRadius>
    <FreePoint Name="FreePoint20" Style="1" X="2.3" Y="-6.725" />
    <LineTwoPoints Name="LineTwoPoints22" Style="8">
      <Dependency Name="FreePoint18" />
      <Dependency Name="FreePoint20" />
    </LineTwoPoints>
    <IntersectionPoint Name="IntersectionPoint27" Style="3" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="LineTwoPoints22" />
      <Dependency Name="CircleByRadius19" />
    </IntersectionPoint>
    <ReflectedPoint Name="ReflectedPoint28" Style="3">
      <Dependency Name="FreePoint18" />
      <Dependency Name="IntersectionPoint27" />
    </ReflectedPoint>
    <Circle Name="Circle30" Style="8">
      <Dependency Name="IntersectionPoint27" />
      <Dependency Name="FreePoint18" />
    </Circle>
    <Circle Name="Circle32" Style="8">
      <Dependency Name="ReflectedPoint28" />
      <Dependency Name="IntersectionPoint27" />
    </Circle>
    <ReflectedPoint Name="ReflectedPoint35" Style="3">
      <Dependency Name="IntersectionPoint27" />
      <Dependency Name="ReflectedPoint28" />
    </ReflectedPoint>
    <Circle Name="Circle37" Style="8">
      <Dependency Name="ReflectedPoint35" />
      <Dependency Name="ReflectedPoint28" />
    </Circle>
    <IntersectionPoint Name="IntersectionPoint38" Style="3" Algorithm="IntersectCircleAndCircle2">
      <Dependency Name="Circle32" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint39" Style="3" Algorithm="IntersectCircleAndCircle1">
      <Dependency Name="Circle32" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <Circle Name="Circle41" Style="8">
      <Dependency Name="IntersectionPoint38" />
      <Dependency Name="IntersectionPoint27" />
    </Circle>
    <Circle Name="Circle43" Style="8">
      <Dependency Name="IntersectionPoint39" />
      <Dependency Name="IntersectionPoint27" />
    </Circle>
    <IntersectionPoint Name="IntersectionPoint44" Style="3" Algorithm="IntersectCircleAndCircle2">
      <Dependency Name="Circle43" />
      <Dependency Name="Circle37" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint45" Style="3" Algorithm="IntersectCircleAndCircle1">
      <Dependency Name="Circle41" />
      <Dependency Name="Circle32" />
    </IntersectionPoint>
    <Segment Name="Segment47" Style="8">
      <Dependency Name="IntersectionPoint45" />
      <Dependency Name="FreePoint18" />
    </Segment>
    <Segment Name="Segment49" Style="8">
      <Dependency Name="FreePoint18" />
      <Dependency Name="IntersectionPoint44" />
    </Segment>
    <Segment Name="Segment51" Style="8">
      <Dependency Name="IntersectionPoint44" />
      <Dependency Name="IntersectionPoint45" />
    </Segment>
    <IntersectionPoint Name="IntersectionPoint52" Style="2" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Segment47" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint53" Style="2" Algorithm="IntersectLineAndCircle2">
      <Dependency Name="Segment49" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint60" Style="3" Algorithm="IntersectCircleAndCircle2">
      <Dependency Name="Circle30" />
      <Dependency Name="CircleByRadius19" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint61" Style="3" Algorithm="IntersectCircleAndCircle1">
      <Dependency Name="Circle30" />
      <Dependency Name="CircleByRadius19" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint64" Style="2" Algorithm="IntersectLineAndLine">
      <Dependency Name="Segment51" />
      <Dependency Name="LineTwoPoints22" />
    </IntersectionPoint>
    <Segment Name="Segment66" Style="8">
      <Dependency Name="IntersectionPoint60" />
      <Dependency Name="IntersectionPoint64" />
    </Segment>
    <Segment Name="Segment68" Style="8">
      <Dependency Name="IntersectionPoint64" />
      <Dependency Name="IntersectionPoint61" />
    </Segment>
    <IntersectionPoint Name="IntersectionPoint69" Style="2" Algorithm="IntersectLineAndCircle2">
      <Dependency Name="Segment66" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint70" Style="2" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Segment68" />
      <Dependency Name="Circle30" />
    </IntersectionPoint>
    <Segment Name="Segment72" Style="4">
      <Dependency Name="IntersectionPoint52" />
      <Dependency Name="IntersectionPoint69" />
    </Segment>
    <Segment Name="Segment74" Style="4">
      <Dependency Name="IntersectionPoint70" />
      <Dependency Name="IntersectionPoint53" />
    </Segment>
    <ReflectedPoint Name="ReflectedPoint75" Style="2">
      <Dependency Name="IntersectionPoint27" />
      <Dependency Name="IntersectionPoint38" />
    </ReflectedPoint>
    <ReflectedPoint Name="ReflectedPoint76" Style="2">
      <Dependency Name="IntersectionPoint27" />
      <Dependency Name="IntersectionPoint39" />
    </ReflectedPoint>
    <Ray Name="Ray78" Style="8">
      <Dependency Name="ReflectedPoint75" />
      <Dependency Name="FreePoint18" />
    </Ray>
    <Ray Name="Ray80" Style="8">
      <Dependency Name="ReflectedPoint76" />
      <Dependency Name="FreePoint18" />
    </Ray>
    <IntersectionPoint Name="IntersectionPoint81" Style="3" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Ray80" />
      <Dependency Name="CircleByRadius19" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint82" Style="3" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Ray78" />
      <Dependency Name="CircleByRadius19" />
    </IntersectionPoint>
    <Ray Name="Ray84" Style="8">
      <Dependency Name="ReflectedPoint75" />
      <Dependency Name="IntersectionPoint52" />
    </Ray>
    <Ray Name="Ray86" Style="8">
      <Dependency Name="ReflectedPoint76" />
      <Dependency Name="IntersectionPoint53" />
    </Ray>
    <IntersectionPoint Name="IntersectionPoint87" Style="3" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Ray84" />
      <Dependency Name="Circle43" />
    </IntersectionPoint>
    <IntersectionPoint Name="IntersectionPoint88" Style="3" Algorithm="IntersectLineAndCircle1">
      <Dependency Name="Ray86" />
      <Dependency Name="Circle41" />
    </IntersectionPoint>
    <Ray Name="Ray90" Style="8">
      <Dependency Name="IntersectionPoint53" />
      <Dependency Name="IntersectionPoint45" />
    </Ray>
    <Ray Name="Ray92" Style="8">
      <Dependency Name="IntersectionPoint52" />
      <Dependency Name="IntersectionPoint44" />
    </Ray>
    <Arc Name="Arc96" Style="9">
      <Dependency Name="IntersectionPoint53" />
      <Dependency Name="IntersectionPoint88" />
      <Dependency Name="IntersectionPoint45" />
    </Arc>
    <Arc Name="Arc100" Style="9">
      <Dependency Name="ReflectedPoint76" />
      <Dependency Name="IntersectionPoint81" />
      <Dependency Name="IntersectionPoint88" />
    </Arc>
    <Arc Name="Arc104" Style="9">
      <Dependency Name="ReflectedPoint75" />
      <Dependency Name="IntersectionPoint87" />
      <Dependency Name="IntersectionPoint82" />
    </Arc>
    <Arc Name="Arc108" Style="9">
      <Dependency Name="FreePoint18" />
      <Dependency Name="IntersectionPoint82" />
      <Dependency Name="IntersectionPoint81" />
    </Arc>
    <IntersectionPoint Name="IntersectionPoint109" Style="3" Algorithm="IntersectLineAndLine">
      <Dependency Name="Ray92" />
      <Dependency Name="LineTwoPoints22" />
    </IntersectionPoint>
    <Circle Name="Circle113" Visible="false" Style="8">
      <Dependency Name="IntersectionPoint53" />
      <Dependency Name="IntersectionPoint88" />
    </Circle>
    <IntersectionPoint Name="IntersectionPoint116" Style="3" Algorithm="IntersectCircleAndLine1">
      <Dependency Name="Circle113" />
      <Dependency Name="Ray90" />
    </IntersectionPoint>
    <ReflectedPoint Name="ReflectedPoint117" Style="3">
      <Dependency Name="IntersectionPoint116" />
      <Dependency Name="LineTwoPoints22" />
    </ReflectedPoint>
    <Arc Name="Arc121" Style="9">
      <Dependency Name="IntersectionPoint109" />
      <Dependency Name="IntersectionPoint116" />
      <Dependency Name="ReflectedPoint117" />
    </Arc>
    <Arc Name="Arc125" Style="9">
      <Dependency Name="IntersectionPoint52" />
      <Dependency Name="ReflectedPoint117" />
      <Dependency Name="IntersectionPoint87" />
    </Arc>
    <Label Name="Label126" Style="6" Text="5-point egg" X="-12.45" Y="6.7" />
    <Label Name="Label127" Style="7" Text="radius" X="-3.4" Y="5.125" />
    <Label Name="Label128" Style="7" Text="Search for a book called &quot;Mathographics&quot; &#xD;by Robert Dixon" X="-12.25" Y="5.275" />
  </Figures>
</Drawing>
Sep 5, 2009 at 1:29 PM

Thanks, the fix worked perfectly.  Mathographics is a great book, many of the drawings can be done with just a straight-edge, compass, and pencil.  It definitely inspired me.

By the way, your drawing looks great, much better style and interactivity, but it's not quite right.  The bottom of the 'egg' should be tangential to the bottom circle.  There are actually four different arcs in the bottom, where you have only one.

Also, after downloading the source, I noticed that the WPF version had much better error handling, in that I was able to get the error message and trace down the source of the problem.

I would be glad to help out.  I'll see if I can make any improvements to share.  I'm in the process of porting my project, XML Explorer, to WPF as well.

Anyway, thanks again!

Jason