[heekscad] r1493 committed - changes for gears, copied over from github repository.

8 views
Skip to first unread message

codesite...@google.com

unread,
Nov 5, 2011, 3:11:17 AM11/5/11
to heeksca...@googlegroups.com
Revision: 1493
Author: danheeks
Date: Sat Nov 5 00:07:11 2011
Log: changes for gears, copied over from github repository.
http://code.google.com/p/heekscad/source/detail?r=1493

Added:
/trunk/bitmaps/add_intersection_points.png
/trunk/bitmaps/linked.png
Modified:
/trunk/bitmaps/angle/angle bitmaps.svg
/trunk/bitmaps/bitmaps.svg
/trunk/src/AboutBox.cpp
/trunk/src/AboutBox.h
/trunk/src/AutoSave.cpp
/trunk/src/AutoSave.h
/trunk/src/BentleyOttmann.cpp
/trunk/src/BentleyOttmann.h
/trunk/src/BezierCurve.cpp
/trunk/src/BezierCurve.h
/trunk/src/ConstraintTools.cpp
/trunk/src/ConstraintTools.h
/trunk/src/ConversionTools.cpp
/trunk/src/ConversionTools.h
/trunk/src/CorrelationTool.cpp
/trunk/src/CorrelationTool.h
/trunk/src/CxfFont.cpp
/trunk/src/DigitizeMode.cpp
/trunk/src/DigitizeMode.h
/trunk/src/DigitizedPoint.cpp
/trunk/src/DigitizedPoint.h
/trunk/src/DimensionDrawing.cpp
/trunk/src/DimensionDrawing.h
/trunk/src/Drawing.cpp
/trunk/src/Drawing.h
/trunk/src/Edge.cpp
/trunk/src/EdgeBlend.h
/trunk/src/EndedObject.cpp
/trunk/src/FaceTools.h
/trunk/src/FastCurves.h
/trunk/src/GLList.cpp
/trunk/src/GLList.h
/trunk/src/Geom.cpp
/trunk/src/GraphicsCanvas.h
/trunk/src/Grid.cpp
/trunk/src/Grid.h
/trunk/src/Gripper.cpp
/trunk/src/Gripper.h
/trunk/src/GripperSelTransform.cpp
/trunk/src/GripperSelTransform.h
/trunk/src/HAngularDimension.h
/trunk/src/HDimension.h
/trunk/src/HGear.cpp
/trunk/src/HGear.h
/trunk/src/HImage.h
/trunk/src/HPoint.h
/trunk/src/HSpline.cpp
/trunk/src/HSpline.h
/trunk/src/HText.h
/trunk/src/HXml.h
/trunk/src/HeeksCAD VC2008.vcproj
/trunk/src/HeeksCAD.cpp
/trunk/src/HeeksCAD.h
/trunk/src/HeeksConfig.h
/trunk/src/HeeksFrame.cpp
/trunk/src/HeeksPrintout.cpp
/trunk/src/HeeksPrintout.h
/trunk/src/InputModeCanvas.cpp
/trunk/src/InputModeCanvas.h
/trunk/src/Intersector.h
/trunk/src/LineArcDrawing.cpp
/trunk/src/LineArcDrawing.h
/trunk/src/Loop.cpp
/trunk/src/MagDragWindow.cpp
/trunk/src/MagDragWindow.h
/trunk/src/MarkedList.cpp
/trunk/src/MarkedList.h
/trunk/src/MenuSeparator.h
/trunk/src/MultiPoly.cpp
/trunk/src/MultiPoly.h
/trunk/src/NearMap.h
/trunk/src/ObjPropsCanvas.cpp
/trunk/src/ObjPropsCanvas.h
/trunk/src/OptionsCanvas.cpp
/trunk/src/OptionsCanvas.h
/trunk/src/OrientationModifier.cpp
/trunk/src/OrientationModifier.h
/trunk/src/Plugins.cpp
/trunk/src/Plugins.h
/trunk/src/PointDrawing.cpp
/trunk/src/PointDrawing.h
/trunk/src/PointOrWindow.cpp
/trunk/src/PointOrWindow.h
/trunk/src/Polygon.cpp
/trunk/src/Polygon.h
/trunk/src/PropertiesCanvas.cpp
/trunk/src/PropertiesCanvas.h
/trunk/src/PropertyTrsf.cpp
/trunk/src/PropertyTrsf.h
/trunk/src/RS274X.cpp
/trunk/src/RegularShapesDrawing.cpp
/trunk/src/RegularShapesDrawing.h
/trunk/src/Ruler.h
/trunk/src/SelectMode.cpp
/trunk/src/SelectMode.h
/trunk/src/Shape.cpp
/trunk/src/ShapeData.cpp
/trunk/src/ShapeData.h
/trunk/src/SimpleIntersector.h
/trunk/src/Sketch.h
/trunk/src/SketchTools.cpp
/trunk/src/SketchTools.h
/trunk/src/SolidTools.cpp
/trunk/src/SolidTools.h
/trunk/src/SolveSketch.h
/trunk/src/StretchTool.cpp
/trunk/src/StretchTool.h
/trunk/src/TransformTool.cpp
/trunk/src/TransformTool.h
/trunk/src/TransformTools.cpp
/trunk/src/TransformTools.h
/trunk/src/UndoEngine.h
/trunk/src/ViewPanning.h
/trunk/src/ViewPoint.cpp
/trunk/src/ViewPoint.h
/trunk/src/ViewRotating.h
/trunk/src/ViewZooming.h
/trunk/src/Window.cpp
/trunk/src/Window.h
/trunk/src/advprops.cpp
/trunk/src/advprops.h
/trunk/src/dxf.cpp
/trunk/src/dxf.h
/trunk/src/manager.cpp
/trunk/src/manager.h
/trunk/src/odcombo.cpp
/trunk/src/odcombo.h
/trunk/src/propdev.h
/trunk/src/propgrid.h
/trunk/src/props.cpp
/trunk/src/stdafx.cpp
/trunk/src/svg.cpp
/trunk/src/svg.h
/trunk/src/wxImageLoader.cpp
/trunk/src/wxImageLoader.h
/trunk/translations/CMakeLists.txt
/trunk/translations/de/HeeksCAD.po
/trunk/translations/it/HeeksCAD.po
/trunk/translations/sk/HeeksCAD.po

=======================================
--- /dev/null
+++ /trunk/bitmaps/add_intersection_points.png Sat Nov 5 00:07:11 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/bitmaps/linked.png Sat Nov 5 00:07:11 2011
Binary file, no diff available.
=======================================
--- /trunk/bitmaps/bitmaps.svg Mon Jun 13 02:08:06 2011
+++ /trunk/bitmaps/bitmaps.svg Sat Nov 5 00:07:11 2011
@@ -5880,16 +5880,16 @@
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="4.0000002"
- inkscape:cx="141.91421"
- inkscape:cy="693.26399"
+ inkscape:zoom="1.4142136"
+ inkscape:cx="102.91421"
+ inkscape:cy="3.5364407"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1914"
inkscape:window-height="1139"
inkscape:window-x="0"
- inkscape:window-y="18"
+ inkscape:window-y="25"
inkscape:snap-global="true"
showguides="true"
inkscape:guide-bbox="true">
@@ -10312,5 +10312,33 @@
inkscape:export-filename="C:\Users\Dan\HeeksCAD\bitmaps\gear.png"
inkscape:export-xdpi="239.16956"
inkscape:export-ydpi="239.16956" />
+ <text
+ xml:space="preserve"
+
style="font-size:40px;font-style:normal;font-weight:normal;text-align:start;line-height:125%;writing-mode:lr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream
Vera Sans"
+ x="23.830645"
+ y="914.65063"
+ id="text3967"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3971">Select</tspan></text>
+ <g
+ id="g4766"
+ transform="matrix(0.5256522,0,0,0.52024,-26.065181,418.36277)"
+
inkscape:export-filename="C:\Users\Dan\heeks\heekscad\bitmaps\linked.png"
+ inkscape:export-xdpi="284.05212"
+ inkscape:export-ydpi="284.05212">
+ <path
+ id="path3973"
+ d="M 124.46875,1009.0938 C 122.40538,1008.7518
120.31515,1009.2161 118.59375,1010.9375 C 111.52268,1018.0086
113.59376,1015.9375 108.59375,1020.9375 C 101.70814,1027.8231
114.52063,1040.6669 121.40625,1033.7812 C 126.40625,1028.7813
126.40625,1028.7812 131.40625,1023.7812 C 136.57047,1018.617
130.65885,1010.1196 124.46875,1009.0938 z M 122.75,1013.0625 C
126.16649,1012.3914 131.31883,1018.2124 128.59375,1020.9375 C
123.59375,1025.9375 123.59375,1025.9375 118.59375,1030.9375 C
115.47937,1034.0519 108.29186,1026.8957 111.40625,1023.7812 C
116.40626,1018.7813 114.33518,1020.8524 121.40625,1013.7812 C
121.79555,1013.392 122.26193,1013.1584 122.75,1013.0625 z"
+
style="fill:#86eefd;fill-opacity:1;fill-rule:evenodd;stroke:#586d21;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
/>
+ <path
+ id="path4763"
+ d="M 154.71875,978.39348 C 152.65538,978.05148
150.56515,978.51578 148.84375,980.23718 C 141.77268,987.3083
143.84376,985.2372 138.84375,990.2372 C 131.95814,997.1228
144.77063,1009.9666 151.65625,1003.0809 C 156.65625,998.081
156.65625,998.0809 161.65625,993.0809 C 166.82047,987.9167
160.90885,979.41928 154.71875,978.39348 z M 153,982.36218 C
156.41649,981.69108 161.56883,987.5121 158.84375,990.2372 C
153.84375,995.2372 153.84375,995.2372 148.84375,1000.2372 C
145.72937,1003.3516 138.54186,996.1954 141.65625,993.0809 C
146.65626,988.081 144.58518,990.1521 151.65625,983.08088 C
152.04555,982.69168 152.51193,982.45808 153,982.36218 z"
+
style="fill:#86eefd;fill-opacity:1;fill-rule:evenodd;stroke:#586d21;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
/>
+ <path
+ id="path4755"
+ d="M 144.75,995.34375 C 144.30923,995.40743 143.90232,995.61638
143.59375,995.9375 L 123.59375,1015.9375 C 123.06879,1016.4363
122.85443,1017.1799 123.03332,1017.8816 C 123.2122,1018.5833
123.75638,1019.1335 124.45608,1019.3202 C 125.15577,1019.5068
125.90168,1019.3006 126.40625,1018.7812 L 146.40625,998.78125 C
147.04278,998.18342 147.21791,997.24175 146.83886,996.45505 C
146.45981,995.66836 145.61422,995.21849 144.75,995.34375 L 144.75,995.34375
z"
+
style="fill:#82f1f2;fill-opacity:1;fill-rule:evenodd;stroke:#2b425a;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
/>
+ </g>
</g>
</svg>
=======================================
--- /trunk/src/AboutBox.h Tue May 5 15:36:43 2009
+++ /trunk/src/AboutBox.h Sat Nov 5 00:07:11 2011
@@ -2,7 +2,12 @@
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING
for details.

+/*!
+ * \brief An About Box:
+ * Perhaps someone smart could say something useful about this */
+
class CAboutBox: public wxDialog{
+
public:
CAboutBox(wxWindow *parent);

=======================================
--- /trunk/src/ConversionTools.cpp Mon May 23 00:48:55 2011
+++ /trunk/src/ConversionTools.cpp Sat Nov 5 00:07:11 2011
@@ -566,12 +566,21 @@

case GeomAbs_BSplineCurve:
{
- BRepAdaptor_Curve curve(edge);
std::list<HeeksObj*> new_spans;
- HSpline::ToBiarcs(curve.BSpline(), new_spans, deviation);
- for(std::list<HeeksObj*>::iterator It = new_spans.begin(); It !=
new_spans.end(); It++)
- {
- sketch->Add(*It, NULL);
+ HSpline::ToBiarcs(curve.BSpline(), new_spans, deviation,
curve.FirstParameter(), curve.LastParameter());
+ if(sense)
+ {
+ for(std::list<HeeksObj*>::iterator It = new_spans.begin(); It !=
new_spans.end(); It++)
+ sketch->Add(*It, NULL);
+ }
+ else
+ {
+ for(std::list<HeeksObj*>::reverse_iterator It = new_spans.rbegin();
It != new_spans.rend(); It++)
+ {
+ HeeksObj* object = *It;
+ CSketch::ReverseObject(object);
+ sketch->Add(object, NULL);
+ }
}
}
break;
=======================================
--- /trunk/src/DigitizeMode.cpp Tue Jun 21 20:10:37 2011
+++ /trunk/src/DigitizeMode.cpp Sat Nov 5 00:07:11 2011
@@ -111,7 +111,7 @@
if(lbutton_point.m_type != DigitizeNoItemType){
digitized_point = lbutton_point;
if(m_doing_a_main_loop){
- wxGetApp().ExitMainLoop();
+ ExitMainLoop();
}
}
}
@@ -138,7 +138,7 @@
{
case WXK_ESCAPE:
digitized_point.m_type = DigitizeNoItemType;
- if(m_doing_a_main_loop)wxGetApp().ExitMainLoop();
+ if(m_doing_a_main_loop)ExitMainLoop();
break;
}
}
@@ -447,7 +447,7 @@
void Run(){
if(wxGetApp().m_digitizing->m_doing_a_main_loop)
{
- wxGetApp().ExitMainLoop();
+ ExitMainLoop();
}
else{
wxMessageBox(_("Error! The 'Stop Picking' button shouldn't have been
available!"));
=======================================
--- /trunk/src/Edge.cpp Mon May 23 00:48:55 2011
+++ /trunk/src/Edge.cpp Sat Nov 5 00:07:11 2011
@@ -185,7 +185,6 @@
static ChamferTool chamfer_tool;


-
class EdgeToSketchTool:public Tool
{
public:
@@ -200,11 +199,57 @@

static EdgeToSketchTool make_sketch_tool;

+static bool EdgeIsFlat(CEdge* edge)
+{
+ bool flat = fabs(edge->GetVertex0()->m_point[2] -
edge->GetVertex1()->m_point[2]) < wxGetApp().m_geom_tol;
+ return flat;
+}
+
+class SelectLinkedEdgesTool:public Tool
+{
+public:
+ const wxChar* GetTitle(){return _("Select Flat Linked Edges");}
+ wxString BitmapPath(){return _T("linked");}
+ void Run(){
+ if(edge_for_tools == NULL)return;
+ std::list<CEdge*> live_edges;
+ std::set<CEdge*> edges_to_mark;
+ edges_to_mark.insert(edge_for_tools);
+ live_edges.push_back(edge_for_tools);
+ while(live_edges.size() > 0)
+ {
+ CEdge* current_edge = live_edges.front();
+ live_edges.pop_front();
+ for(int i = 0; i<2; i++)
+ {
+ CVertex* vertex =
(i==0)?current_edge->GetVertex0():current_edge->GetVertex1();
+ for(CEdge* edge = vertex->GetFirstEdge(); edge; edge =
vertex->GetNextEdge())
+ {
+ if(edge != current_edge &&
(wxGetApp().m_marked_list->ObjectMarked(edge) == false) &&
(edges_to_mark.find(edge) == edges_to_mark.end()) && EdgeIsFlat(edge))
+ {
+ edges_to_mark.insert(edge);
+ live_edges.push_back(edge);
+ }
+ }
+ }
+ }
+
+ std::list<HeeksObj*> obj_list;
+ for(std::set<CEdge*>::iterator It = edges_to_mark.begin(); It !=
edges_to_mark.end(); It++)obj_list.push_back(*It);
+ wxGetApp().m_marked_list->Add(obj_list, true);
+ }
+ bool CallChangedOnRun(){return false;}
+};
+
+static SelectLinkedEdgesTool link_flat_tool;
+
+
void CEdge::GetTools(std::list<Tool*>* t_list, const wxPoint* p){
edge_for_tools = this;
if(!wxGetApp().m_no_creation_mode &&
GetParentBody())t_list->push_back(&fillet_tool);
if(!wxGetApp().m_no_creation_mode)t_list->push_back(&chamfer_tool);
if(!wxGetApp().m_no_creation_mode)t_list->push_back(&make_sketch_tool);
+ if(!wxGetApp().m_no_creation_mode)t_list->push_back(&link_flat_tool);
}

void CEdge::Blend(double radius, bool chamfer_not_fillet){
=======================================
--- /trunk/src/HGear.cpp Wed Jun 22 01:02:30 2011
+++ /trunk/src/HGear.cpp Sat Nov 5 00:07:11 2011
@@ -10,6 +10,7 @@
#include "../interface/PropertyLength.h"
#include "Gripper.h"
#include "HLine.h"
+#include "HSpline.h"

HGear::HGear(const HGear &o){
operator=(o);
@@ -75,6 +76,8 @@
static PhiAndAngle inside_phi_and_angle(0.0, 0.0);
static PhiAndAngle tip_relief_phi_and_angle(0.0, 0.0);
static PhiAndAngle middle_phi_and_angle(0.0, 0.0);
+static CSketch* sketch_for_gear = NULL;
+static std::list<gp_Pnt> spline_points_for_gear;

void point_at_phi(double phi, double &px, double &py)
{
@@ -131,14 +134,41 @@
transform_for_cone_and_depth(p);

p.Transform(mat_for_point);
- double pp[3];
- extract(p, pp);
- (*callbackfunc_for_point)(pp);
+ if(sketch_for_gear)
+ {
+ spline_points_for_gear.push_back(p);
+ }
+
+ if(callbackfunc_for_point)
+ {
+ double pp[3];
+ extract(p, pp);
+ (*callbackfunc_for_point)(pp);
+ }
+}
+
+void add_spline()
+{
+ // add spline
+ if(sketch_for_gear == NULL)return;
+
+ if(spline_points_for_gear.size() < 2)return;
+
+ if(spline_points_for_gear.size() == 2)
+ sketch_for_gear->Add(new HLine(spline_points_for_gear.front(),
spline_points_for_gear.back(), &wxGetApp().current_color), NULL);
+ else
+ sketch_for_gear->Add(new HSpline(spline_points_for_gear,
&wxGetApp().current_color), NULL);
+
+ // clear points, retaining last one
+ gp_Pnt back = spline_points_for_gear.back();
+ spline_points_for_gear.clear();
+ spline_points_for_gear.push_back(back);
}

void involute(double tooth_angle, bool do_reverse)
{
int steps = 10;
+ bool first = true;

for(int i = do_reverse ? (steps) : 0; do_reverse ? (i>= 0) : (i<=steps); )
{
@@ -155,6 +185,8 @@

// output the point
point(x, y);
+ if(first)add_spline();
+ first = false;

if(do_reverse)i--;
else i++;
@@ -203,7 +235,7 @@
// incremental_angle - to space the middle point at a quarter of a cycle
double incremental_angle = 0.5*Pi/gear_for_point->m_num_teeth -
middle_phi_and_angle.angle;
double angle1 = tooth_angle - (inside_phi_and_angle.angle +
incremental_angle);
- double angle2 = tooth_angle + (inside_phi_and_angle.angle +
incremental_angle);
+// double angle2 = tooth_angle + (inside_phi_and_angle.angle +
incremental_angle);
double angle3 = tooth_angle + (outside_phi_and_angle.angle +
incremental_angle);
double angle4 = next_tooth_angle - (outside_phi_and_angle.angle +
incremental_angle);
double angle5 = next_tooth_angle - (inside_phi_and_angle.angle +
incremental_angle);
@@ -211,26 +243,36 @@
if(!make_closed_tooth_form && fabs(gear_for_point->m_clearance) >
0.0000000001)
{
if(i==0 && want_start_point)clearance_point1(tooth_angle);
+ add_spline();
clearance_point2(tooth_angle);
}
else
{
if(i==0 && want_start_point)point_at_rad_and_angle(inside_radius,
angle1);
}
+
+ add_spline();

involute(tooth_angle + incremental_angle, false);

+ add_spline();
+
if(fabs(gear_for_point->m_tip_relief) > 0.00000000001)
{
point_at_rad_and_angle(outside_radius, angle3 +
(gear_for_point->m_tip_relief/2)/outside_radius);
+ add_spline();
point_at_rad_and_angle(outside_radius, angle4 -
(gear_for_point->m_tip_relief/2)/outside_radius);
+ add_spline();
}

involute(next_tooth_angle - incremental_angle, true);

+ add_spline();
+
if(!make_closed_tooth_form && fabs(gear_for_point->m_clearance) >
0.0000000001)
{
clearance_point1(next_tooth_angle);
+ add_spline();
}

if(make_closed_tooth_form)
@@ -265,6 +307,7 @@
outside_phi_and_angle = involute_intersect(outside_radius);
tip_relief_phi_and_angle = involute_intersect(outside_radius -
m_tip_relief);
middle_phi_and_angle = involute_intersect(pitch_radius);
+ spline_points_for_gear.clear();
}

void HGear::GetSegments(void(*callbackfunc)(const double *p), double
pixels_per_mm, bool want_start_point)const
@@ -276,6 +319,21 @@
tooth(i, i==0 && want_start_point, false);
}
}
+
+HeeksObj* HGear::MakeSketch()const
+{
+ sketch_for_gear = new CSketch();
+ SetSegmentsVariables(NULL);
+
+ for(int i = 0; i<m_num_teeth; i++)
+ {
+ tooth(i, true, false);
+ }
+
+ CSketch* sketch = sketch_for_gear;
+ sketch_for_gear = NULL;
+ return sketch;
+}

void HGear::GetInnerRingSegments(void(*callbackfunc)(const double *p),
double pixels_per_mm, bool want_start_point)const
{
@@ -472,23 +530,21 @@
{
public:
void Run(){
- sketch_for_make = new CSketch();
-
height_for_point = 0.0;
lines_started = false;
+
+ void(*callbackfunc)(const double *p) = NULL;
+ callbackfunc = lineAddFunction;
+
if(oneTooth())
{
- object_for_Tool->GetOneToothSegments(lineAddFunction,
wxGetApp().GetPixelScale());
+ object_for_Tool->GetOneToothSegments(callbackfunc,
wxGetApp().GetPixelScale());
+ wxGetApp().Add(sketch_for_make, NULL);
}
else
{
- object_for_Tool->GetSegments(lineAddFunction,
wxGetApp().GetPixelScale());
- lines_started = false;
- wxGetApp().Add(sketch_for_make, NULL);
- sketch_for_make = new CSketch();
- object_for_Tool->GetInnerRingSegments(lineAddFunction,
wxGetApp().GetPixelScale());
- }
- wxGetApp().Add(sketch_for_make, NULL);
+ wxGetApp().Add(object_for_Tool->MakeSketch(), NULL);
+ }

if(fabs(object_for_Tool->m_depth) > 0.000000000001)
{
@@ -497,17 +553,13 @@
sketch_for_make = new CSketch();
if(oneTooth())
{
- object_for_Tool->GetOneToothSegments(lineAddFunction,
wxGetApp().GetPixelScale());
+ object_for_Tool->GetOneToothSegments(callbackfunc,
wxGetApp().GetPixelScale());
+ wxGetApp().Add(sketch_for_make, NULL);
}
else
{
- object_for_Tool->GetSegments(lineAddFunction,
wxGetApp().GetPixelScale());
- lines_started = false;
- wxGetApp().Add(sketch_for_make, NULL);
- sketch_for_make = new CSketch();
- object_for_Tool->GetInnerRingSegments(lineAddFunction,
wxGetApp().GetPixelScale());
- }
- wxGetApp().Add(sketch_for_make, NULL);
+ wxGetApp().Add(object_for_Tool->MakeSketch(), NULL);
+ }
}
}
const wxChar* GetTitle(){return _("Make Sketches");}
=======================================
--- /trunk/src/HGear.h Wed Jun 22 01:02:30 2011
+++ /trunk/src/HGear.h Sat Nov 5 00:07:11 2011
@@ -49,4 +49,5 @@
static HeeksObj* ReadFromXMLElement(TiXmlElement* pElem);
void GetInnerRingSegments(void(*callbackfunc)(const double *p), double
pixels_per_mm, bool want_start_point = true)const;
void GetOneToothSegments(void(*callbackfunc)(const double *p), double
pixels_per_mm, bool want_start_point = true)const;
+ HeeksObj* MakeSketch()const;
};
=======================================
--- /trunk/src/HSpline.cpp Wed Feb 2 04:46:13 2011
+++ /trunk/src/HSpline.cpp Sat Nov 5 00:07:11 2011
@@ -568,7 +568,7 @@
return true;
}

-void HSpline::ToBiarcs(const Handle_Geom_BSplineCurve s,
std::list<HeeksObj*> &new_spans, double tolerance)
+void HSpline::ToBiarcs(const Handle_Geom_BSplineCurve s,
std::list<HeeksObj*> &new_spans, double tolerance, double first_parameter,
double last_parameter)
{
new_spans_for_CreateArcs = &new_spans;
if(tolerance < 0.000000000000001)tolerance = 0.000000000000001;
@@ -577,14 +577,14 @@
gp_Vec v_start;
gp_Pnt p_end;
gp_Vec v_end;
- s->D1(s->FirstParameter(), p_start, v_start);
+ s->D1(first_parameter, p_start, v_start);
spline_for_CreateArcs = s;
- CreateArcs(p_start, v_start, s->FirstParameter(), s->LastParameter(),
p_end, v_end);
+ CreateArcs(p_start, v_start, first_parameter, last_parameter, p_end,
v_end);
}

void HSpline::ToBiarcs(std::list<HeeksObj*> &new_spans, double
tolerance)const
{
- ToBiarcs(m_spline, new_spans, tolerance);
+ ToBiarcs(m_spline, new_spans, tolerance, m_spline->FirstParameter(),
m_spline->LastParameter());
}

void HSpline::Reverse()
=======================================
--- /trunk/src/HSpline.h Wed Feb 2 04:46:13 2011
+++ /trunk/src/HSpline.h Sat Nov 5 00:07:11 2011
@@ -62,6 +62,6 @@
bool GetEndPoint(double* pos);

void ToBiarcs(std::list<HeeksObj*> &new_spans, double tolerance)const;
- static void ToBiarcs(const Handle_Geom_BSplineCurve s,
std::list<HeeksObj*> &new_spans, double tolerance);
+ static void ToBiarcs(const Handle_Geom_BSplineCurve s,
std::list<HeeksObj*> &new_spans, double tolerance, double first_parameter,
double last_parameter);
void Reverse();
};
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages