Opps I volunteered myself.

I was in a hurry to file a bug report on the problems I was having with the parametric solver.
I didn’t mean to confirm the bug and assign it to myself….
Well…. I guess I should give it a whirl to see if I can figure out what’s going on.

Ok…Code wise it think  I need to start out here.

bool HeeksCADapp::OpenFile(const wxChar *filepath, bool import_not_open, HeeksObj* paste_into, HeeksObj* paste_before, bool retain_filename /* = true */ )

which will fires off
OpenXMLFile(filepath, paste_into, paste_before);

One of the guys on the IRC (thought the Heekscad the constraints in the file where writing out but not reading in..)  I guess thats a good theory to test.

There is something wanky going on here with the File Read/Save of constraints.   I thought I defined the problem but now I’m not so sure.  I think Heekscad is saving everything ok.  I believe the problem is in the reading back.

Tests:
1) Rectangle with with 4 CoincidentPointConstraints  and save as “test_1_4CoincidentPointConstraints.heeks”

2) With the same file open add a vertical and horizontal point constraint and save as “test_2_4CoincidentPointConstraints_2AbsoluteAngleConstraints.heeks”

3) Exit heekscad and restart. Open “test_2_4CoincidentPointConstraints_2AbsoluteAngleConstraints.heeks”  and save into “test_3_4CoincidentPointConstraints_2AbsoluteAngleConstraints_resaved.heeks”

4)Exit heekscad and restart. Open “test_1_4CoincidentPointConstraints.heeks” and save into “test_4_4CoincidentPointConstraints_resaved.heeks”

Observations:

(Test 1) It appears that test_1_4CoincidentPointConstraints.heeks has saved constraints correctly
(Test 2) Normal function occurs when “AbsoluteAngleConstraint” is added to a open file and saved.
(Test 3) The file with 4 AbsoluteAngleConstraint and 4 CoincidantPointConstraint are not read in properly. It appears that the AbsoluteAngleConstraint have not been read in properly.
I’m observing what appears to be a read file and a write file error.  When a file is opened, observed on the screen it appears that the AbsoluteAngleConstraint have been lost but the CoincidantPointConstraint have been read. What is exceeding curious when this file is save 3 of the 4 CoincidantPointConstraint are lost. My theory that on a fresh drawing everything everything saves correctly but things get weird with and existing drawing. It appears that there is a read bug and a write bug saving constraints.

(Test 4) In this test a open 4 lines constrained by the endpoints only. On the screen it appears that everything reads in properly. The endpoints appear constrained properly.  When this datafile is saved 3 of the 4 point constraints are lost.

Hypothesis:
It seems as if normal function occurs on new data drawing.  It appears that data is saving correctly at this point.
It appears that there are read and write errrors related to constraints on an existing drawing.

I could be off on this but I looks as there are two error paths:
AbsoluteAngleConstraints are not being read
A counter error? is occuring when data comes from a existing file not all is being read back.

Well my daughter is about to wake up and that’s going to be the end of the quiet.   Lets see if I can get some help on this.

test_1_4CoincidentPointConstraints.heeks

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<HeeksCAD_Document>
<Sketch title=”Sketch” id=”1″>
<Line col=”0″ id=”1″>
<Point col=”0″ x=”-41″ y=”-5.5″ z=”0″ id=”1″ />
<Point col=”0″ x=”-40″ y=”20″ z=”0″ id=”2″ />
</Line>
<Line col=”0″ id=”2″>
<Point col=”0″ x=”-40″ y=”20″ z=”0″ id=”3″ />
<Point col=”0″ x=”-14″ y=”17″ z=”0″ id=”4″ />
</Line>
<Line col=”0″ id=”3″>
<Point col=”0″ x=”-14″ y=”17″ z=”0″ id=”5″ />
<Point col=”0″ x=”-16″ y=”-2″ z=”0″ id=”6″ />
</Line>
<Line col=”0″ id=”4″>
<Point col=”0″ x=”-16″ y=”-2″ z=”0″ id=”7″ />
<Point col=”0″ x=”-41″ y=”-5.5″ z=”0″ id=”8″ />
</Line>
</Sketch>
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”8″ obj1_type=”2″ obj2_id=”1″ obj2_type=”2″ id=”4″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”2″ obj1_type=”2″ obj2_id=”3″ obj2_type=”2″ id=”1″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”4″ obj1_type=”2″ obj2_id=”5″ obj2_type=”2″ id=”2″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”6″ obj1_type=”2″ obj2_id=”7″ obj2_type=”2″ id=”3″ />
</HeeksCAD_Document>

test_2_4CoincidentPointConstraints_and_4AbsoluteAngleConstraints.heeks

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<HeeksCAD_Document>
<Sketch title=”Sketch” id=”1″>
<Line col=”0″ id=”1″>
<Point col=”0″ x=”-45.5″ y=”-7″ z=”0″ id=”1″ />
<Point col=”0″ x=”-45.5″ y=”17.75″ z=”0″ id=”2″ />
</Line>
<Line col=”0″ id=”2″>
<Point col=”0″ x=”-45.5″ y=”17.75″ z=”0″ id=”3″ />
<Point col=”0″ x=”-14.5″ y=”17.75″ z=”0″ id=”4″ />
</Line>
<Line col=”0″ id=”3″>
<Point col=”0″ x=”-14.5″ y=”17.75″ z=”0″ id=”5″ />
<Point col=”0″ x=”-14.5″ y=”-7″ z=”0″ id=”6″ />
</Line>
<Line col=”0″ id=”4″>
<Point col=”0″ x=”-14.5″ y=”-7″ z=”0″ id=”7″ />
<Point col=”0″ x=”-45.5″ y=”-7″ z=”0″ id=”8″ />
</Line>
</Sketch>
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”8″ obj1_type=”2″ obj2_id=”1″ obj2_type=”2″ id=”4″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”2″ obj1_type=”2″ obj2_id=”3″ obj2_type=”2″ id=”1″ />
<Constraint type=”AbsoluteAngleConstraint” angle=”AbsoluteAngleVertical” length=”0″ obj1_id=”1″ obj1_type=”3″ id=”5″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”4″ obj1_type=”2″ obj2_id=”5″ obj2_type=”2″ id=”2″ />
<Constraint type=”AbsoluteAngleConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”2″ obj1_type=”3″ id=”6″ />
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”6″ obj1_type=”2″ obj2_id=”7″ obj2_type=”2″ id=”3″ />
<Constraint type=”AbsoluteAngleConstraint” angle=”AbsoluteAngleVertical” length=”0″ obj1_id=”3″ obj1_type=”3″ id=”7″ />
<Constraint type=”AbsoluteAngleConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”4″ obj1_type=”3″ id=”8″ />

</HeeksCAD_Document>

test_3_4CoincidentPointConstraints_and_4AbsoluteAngleConstraints_resaved.heeks

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<HeeksCAD_Document>
<Sketch title=”Sketch” id=”1″>
<Line col=”0″ id=”1″>
<Point col=”0″ x=”-50″ y=”-9.5″ z=”0″ id=”1″ />
<Point col=”0″ x=”-50.5″ y=”18.75″ z=”0″ id=”2″ />
</Line>
<Line col=”0″ id=”2″>
<Point col=”0″ x=”-50.5″ y=”18.75″ z=”0″ id=”3″ />
<Point col=”0″ x=”-16.5″ y=”18.75″ z=”0″ id=”4″ />
</Line>
<Line col=”0″ id=”3″>
<Point col=”0″ x=”-16.5″ y=”18.75″ z=”0″ id=”5″ />
<Point col=”0″ x=”-16″ y=”-9.5″ z=”0″ id=”6″ />
</Line>
<Line col=”0″ id=”4″>
<Point col=”0″ x=”-16″ y=”-9.5″ z=”0″ id=”7″ />
<Point col=”0″ x=”-50″ y=”-9.5″ z=”0″ id=”8″ />
</Line>
</Sketch>
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”8″ obj1_type=”2″ obj2_id=”1″ obj2_type=”2″ id=”0″ />
</HeeksCAD_Document>

test_4_4CoincidentPointConstraints_resaved.heeks

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<HeeksCAD_Document>
<Sketch title=”Sketch” id=”1″>
<Line col=”0″ id=”1″>
<Point col=”0″ x=”-45″ y=”-12.5″ z=”0″ id=”1″ />
<Point col=”0″ x=”-42″ y=”24″ z=”0″ id=”2″ />
</Line>
<Line col=”0″ id=”2″>
<Point col=”0″ x=”-42″ y=”24″ z=”0″ id=”3″ />
<Point col=”0″ x=”-6″ y=”20″ z=”0″ id=”4″ />
</Line>
<Line col=”0″ id=”3″>
<Point col=”0″ x=”-6″ y=”20″ z=”0″ id=”5″ />
<Point col=”0″ x=”-10″ y=”-10″ z=”0″ id=”6″ />
</Line>
<Line col=”0″ id=”4″>
<Point col=”0″ x=”-10″ y=”-10″ z=”0″ id=”7″ />
<Point col=”0″ x=”-45″ y=”-12.5″ z=”0″ id=”8″ />
</Line>
</Sketch>
<Constraint type=”CoincidantPointConstraint” angle=”AbsoluteAngleHorizontal” length=”0″ obj1_id=”8″ obj1_type=”2″ obj2_id=”1″ obj2_type=”2″ id=”0″ />
</HeeksCAD_Document>

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *