@@ -729,7 +729,7 @@ var MakerJs;
729729var MakerJs ;
730730( function ( MakerJs ) {
731731 var path ;
732- ( function ( _path ) {
732+ ( function ( path_1 ) {
733733 /**
734734 * @private
735735 */
@@ -795,7 +795,7 @@ var MakerJs;
795795 }
796796 return null ;
797797 }
798- _path . breakAtPoint = breakAtPoint ;
798+ path_1 . breakAtPoint = breakAtPoint ;
799799 } ) ( path = MakerJs . path || ( MakerJs . path = { } ) ) ;
800800} ) ( MakerJs || ( MakerJs = { } ) ) ;
801801var MakerJs ;
@@ -1115,7 +1115,7 @@ var MakerJs;
11151115var MakerJs ;
11161116( function ( MakerJs ) {
11171117 var model ;
1118- ( function ( _model ) {
1118+ ( function ( model_1 ) {
11191119 /**
11201120 * @private
11211121 */
@@ -1219,7 +1219,7 @@ var MakerJs;
12191219 * @private
12201220 */
12211221 function checkInsideForeignModel ( segment , modelToIntersect , farPoint ) {
1222- _model . walkPaths ( modelToIntersect , function ( mx , pathId2 , path2 ) {
1222+ model_1 . walkPaths ( modelToIntersect , function ( mx , pathId2 , path2 ) {
12231223 if ( path2 ) {
12241224 checkInsideForeignPath ( segment , path2 , farPoint ) ;
12251225 }
@@ -1242,14 +1242,14 @@ var MakerJs;
12421242 checkInsideForeignModel ( segment , modelContext , farPoint ) ;
12431243 return ! ! segment . isInside ;
12441244 }
1245- _model . isPathInsideModel = isPathInsideModel ;
1245+ model_1 . isPathInsideModel = isPathInsideModel ;
12461246 /**
12471247 * @private
12481248 */
12491249 function breakAllPathsAtIntersections ( modelToBreak , modelToIntersect , farPoint ) {
12501250 var crossedPaths = [ ] ;
12511251 var overlappedSegments = [ ] ;
1252- _model . walkPaths ( modelToBreak , function ( modelContext , pathId1 , path1 ) {
1252+ model_1 . walkPaths ( modelToBreak , function ( modelContext , pathId1 , path1 ) {
12531253 if ( ! path1 )
12541254 return ;
12551255 //clone this path and make it the first segment
@@ -1264,11 +1264,12 @@ var MakerJs;
12641264 segments : [ segment ]
12651265 } ;
12661266 //keep breaking the segments anywhere they intersect with paths of the other model
1267- _model . walkPaths ( modelToIntersect , function ( mx , pathId2 , path2 ) {
1267+ model_1 . walkPaths ( modelToIntersect , function ( mx , pathId2 , path2 ) {
12681268 if ( path2 ) {
12691269 breakAlongForeignPath ( thisPath . segments , overlappedSegments , path2 ) ;
12701270 }
12711271 } ) ;
1272+ //check each segment whether it is inside or outside
12721273 for ( var i = 0 ; i < thisPath . segments . length ; i ++ ) {
12731274 checkInsideForeignModel ( thisPath . segments [ i ] , modelToIntersect ) ;
12741275 }
@@ -1299,7 +1300,7 @@ var MakerJs;
12991300 */
13001301 function addOrDeleteSegments ( crossedPath , includeInside , includeOutside , firstPass ) {
13011302 function addSegment ( model , pathIdBase , segment ) {
1302- var id = _model . getSimilarPathId ( model , pathIdBase ) ;
1303+ var id = model_1 . getSimilarPathId ( model , pathIdBase ) ;
13031304 model . paths [ id ] = segment . path ;
13041305 }
13051306 function checkAddSegment ( model , pathIdBase , segment ) {
@@ -1342,7 +1343,7 @@ var MakerJs;
13421343 addOrDeleteSegments ( pathsB . crossedPaths [ i ] , includeBInsideA , includeBOutsideA ) ;
13431344 }
13441345 }
1345- _model . combine = combine ;
1346+ model_1 . combine = combine ;
13461347 } ) ( model = MakerJs . model || ( MakerJs . model = { } ) ) ;
13471348} ) ( MakerJs || ( MakerJs = { } ) ) ;
13481349var MakerJs ;
@@ -1419,7 +1420,7 @@ var MakerJs;
14191420var MakerJs ;
14201421( function ( MakerJs ) {
14211422 var measure ;
1422- ( function ( _measure ) {
1423+ ( function ( measure_1 ) {
14231424 /**
14241425 * Total angle of an arc between its start and end angles.
14251426 *
@@ -1430,7 +1431,7 @@ var MakerJs;
14301431 var endAngle = MakerJs . angle . ofArcEnd ( arc ) ;
14311432 return endAngle - arc . startAngle ;
14321433 }
1433- _measure . arcAngle = arcAngle ;
1434+ measure_1 . arcAngle = arcAngle ;
14341435 /**
14351436 * Check for arc being concave or convex towards a given point.
14361437 *
@@ -1450,7 +1451,7 @@ var MakerJs;
14501451 }
14511452 return false ;
14521453 }
1453- _measure . isArcConcaveTowardsPoint = isArcConcaveTowardsPoint ;
1454+ measure_1 . isArcConcaveTowardsPoint = isArcConcaveTowardsPoint ;
14541455 /**
14551456 * Check if a given number is between two given limits.
14561457 *
@@ -1468,7 +1469,7 @@ var MakerJs;
14681469 return Math . min ( limit1 , limit2 ) <= valueInQuestion && valueInQuestion <= Math . max ( limit1 , limit2 ) ;
14691470 }
14701471 }
1471- _measure . isBetween = isBetween ;
1472+ measure_1 . isBetween = isBetween ;
14721473 /**
14731474 * Check if a given angle is between an arc's start and end angles.
14741475 *
@@ -1483,7 +1484,7 @@ var MakerJs;
14831484 //computed angles will not be negative, but the arc may have specified a negative angle, so check against one revolution forward and backward
14841485 return ( isBetween ( angleInQuestion , startAngle , endAngle , exclusive ) || isBetween ( angleInQuestion , startAngle + 360 , endAngle + 360 , exclusive ) || isBetween ( angleInQuestion , startAngle - 360 , endAngle - 360 , exclusive ) ) ;
14851486 }
1486- _measure . isBetweenArcAngles = isBetweenArcAngles ;
1487+ measure_1 . isBetweenArcAngles = isBetweenArcAngles ;
14871488 /**
14881489 * Check if a given point is between a line's end points.
14891490 *
@@ -1504,7 +1505,7 @@ var MakerJs;
15041505 }
15051506 return true ;
15061507 }
1507- _measure . isBetweenPoints = isBetweenPoints ;
1508+ measure_1 . isBetweenPoints = isBetweenPoints ;
15081509 /**
15091510 * Calculates the distance between two points.
15101511 *
@@ -1517,7 +1518,7 @@ var MakerJs;
15171518 var dy = b [ 1 ] - a [ 1 ] ;
15181519 return Math . sqrt ( dx * dx + dy * dy ) ;
15191520 }
1520- _measure . pointDistance = pointDistance ;
1521+ measure_1 . pointDistance = pointDistance ;
15211522 /**
15221523 * @private
15231524 */
@@ -1568,7 +1569,7 @@ var MakerJs;
15681569 }
15691570 return measurement ;
15701571 }
1571- _measure . pathExtents = pathExtents ;
1572+ measure_1 . pathExtents = pathExtents ;
15721573 /**
15731574 * Measures the length of a path.
15741575 *
@@ -1595,7 +1596,7 @@ var MakerJs;
15951596 }
15961597 return value ;
15971598 }
1598- _measure . pathLength = pathLength ;
1599+ measure_1 . pathLength = pathLength ;
15991600 /**
16001601 * Measures the smallest rectangle which contains a model.
16011602 *
@@ -1630,7 +1631,7 @@ var MakerJs;
16301631 measure ( modelToMeasure ) ;
16311632 return totalMeasurement ;
16321633 }
1633- _measure . modelExtents = modelExtents ;
1634+ measure_1 . modelExtents = modelExtents ;
16341635 } ) ( measure = MakerJs . measure || ( MakerJs . measure = { } ) ) ;
16351636} ) ( MakerJs || ( MakerJs = { } ) ) ;
16361637var MakerJs ;
@@ -1731,7 +1732,7 @@ var MakerJs;
17311732var MakerJs ;
17321733( function ( MakerJs ) {
17331734 var exporter ;
1734- ( function ( _exporter ) {
1735+ ( function ( exporter_1 ) {
17351736 /**
17361737 * Renders an item in AutoDesk DFX file format.
17371738 *
@@ -1814,12 +1815,12 @@ var MakerJs;
18141815 function entities ( ) {
18151816 append ( "2" ) ;
18161817 append ( "ENTITIES" ) ;
1817- var exporter = new _exporter . Exporter ( map ) ;
1818+ var exporter = new exporter_1 . Exporter ( map ) ;
18181819 exporter . exportItem ( 'entities' , itemToExport , MakerJs . point . zero ( ) ) ;
18191820 }
18201821 //fixup options
18211822 if ( ! opts . units ) {
1822- var units = _exporter . tryGetModelUnits ( itemToExport ) ;
1823+ var units = exporter_1 . tryGetModelUnits ( itemToExport ) ;
18231824 if ( units ) {
18241825 opts . units = units ;
18251826 }
@@ -1835,7 +1836,7 @@ var MakerJs;
18351836 append ( "EOF" ) ;
18361837 return dxf . join ( '\n' ) ;
18371838 }
1838- _exporter . toDXF = toDXF ;
1839+ exporter_1 . toDXF = toDXF ;
18391840 /**
18401841 * @private
18411842 */
@@ -2351,6 +2352,7 @@ var MakerJs;
23512352 */
23522353 function populateShardPointsFromReferenceCircle ( filletRadius , center , properties ) {
23532354 var referenceCircle = new MakerJs . paths . Circle ( center , filletRadius ) ;
2355+ //get reference circle intersection points
23542356 for ( var i = 0 ; i < 2 ; i ++ ) {
23552357 var circleIntersection = path . intersection ( referenceCircle , properties [ i ] . path ) ;
23562358 if ( ! circleIntersection ) {
@@ -2682,6 +2684,7 @@ var MakerJs;
26822684 * @private
26832685 */
26842686 function follow ( connections , loops ) {
2687+ //for a given point, follow the paths that connect to each other to form loops
26852688 for ( var p in connections ) {
26862689 var linkedPaths = connections [ p ] ;
26872690 if ( linkedPaths ) {
@@ -3257,6 +3260,7 @@ var MakerJs;
32573260 append ( svgGroup . getOpeningTag ( false ) ) ;
32583261 var exp = new exporter . Exporter ( map , fixPoint , fixPath , beginModel , endModel ) ;
32593262 exp . exportItem ( '0' , itemToExport , opts . origin ) ;
3263+ //export layers as groups
32603264 for ( var layer in layers ) {
32613265 var layerGroup = new exporter . XmlTag ( 'g' , { id : layer } ) ;
32623266 for ( var i = 0 ; i < layers [ layer ] . length ; i ++ ) {
@@ -3308,11 +3312,10 @@ var MakerJs;
33083312 models . ConnectTheDots = ConnectTheDots ;
33093313 } ) ( models = MakerJs . models || ( MakerJs . models = { } ) ) ;
33103314} ) ( MakerJs || ( MakerJs = { } ) ) ;
3311- var __extends = this . __extends || function ( d , b ) {
3315+ var __extends = ( this && this . __extends ) || function ( d , b ) {
33123316 for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
33133317 function __ ( ) { this . constructor = d ; }
3314- __ . prototype = b . prototype ;
3315- d . prototype = new __ ( ) ;
3318+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
33163319} ;
33173320var MakerJs ;
33183321( function ( MakerJs ) {
0 commit comments