fl-web-component 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fl-web-component.common.js +34645 -1611
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +4 -15
- package/packages/components/com-card/index.vue +1 -1
- package/packages/components/com-flcanvas/components/bspline.js +31 -34
- package/packages/components/com-flcanvas/components/entityFormatting.js +810 -849
- package/packages/components/com-flcanvas/components/round10.js +17 -17
- package/packages/components/com-flcanvas/index.vue +314 -333
- package/packages/components/com-formDialog/index.vue +6 -4
- package/packages/components/com-graphics/component/ann-tool.vue +263 -208
- package/packages/components/com-graphics/index.vue +366 -773
- package/packages/components/com-graphics/pid.vue +304 -295
- package/packages/components/com-table/column-default.vue +2 -3
- package/packages/components/com-table/column-dynamic.vue +7 -4
- package/packages/components/com-table/column.vue +1 -2
- package/packages/components/com-table/index.vue +6 -5
- package/packages/components/com-tabs/index.vue +1 -2
- package/packages/components/com-tiles/index.vue +134 -136
- package/packages/components/com-treeDynamic/index.vue +1 -1
- package/packages/utils/StreamLoader.js +1548 -1489
- package/packages/utils/StreamLoaderParser.worker.js +9 -14
- package/src/main.js +2 -8
- package/src/utils/cloud.js +28 -28
- package/src/utils/cursor.js +11 -9
- package/src/utils/flgltf-parser.js +257 -245
- package/src/utils/instance-parser.js +20 -22
- package/src/utils/mini-devtool.js +94 -39
- package/src/utils/threejs/measure-angle.js +51 -13
- package/src/utils/threejs/measure-area.js +43 -12
- package/src/utils/threejs/measure-distance.js +43 -12
- package/src/utils/threejs/rain-shader.js +10 -10
- package/src/utils/threejs/snow-shader.js +9 -9
|
@@ -1,902 +1,863 @@
|
|
|
1
|
-
import bSpline from
|
|
2
|
-
import * as THREE from
|
|
1
|
+
import bSpline from './bspline';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
3
|
|
|
4
4
|
//rgb转换
|
|
5
5
|
|
|
6
6
|
function decimalToRGBHex(decimalValue) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
// Ensure the input is a valid integer
|
|
8
|
+
if (!Number.isInteger(decimalValue)) {
|
|
9
|
+
throw new Error('Input must be an integer.');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Ensure the input is within the valid range for 24-bit colors
|
|
13
|
+
if (decimalValue < 0 || decimalValue > 0xffffff) {
|
|
14
|
+
throw new Error('Input must be between 0 and 16777215 (0xFFFFFF).');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Extract the red, green, and blue components
|
|
18
|
+
var red = (decimalValue >> 16) & 0xff;
|
|
19
|
+
var green = (decimalValue >> 8) & 0xff;
|
|
20
|
+
var blue = decimalValue & 0xff;
|
|
21
|
+
|
|
22
|
+
// Convert the RGB components to hexadecimal and format as a string
|
|
23
|
+
var hex =
|
|
24
|
+
'#' +
|
|
25
|
+
red.toString(16).padStart(2, '0') +
|
|
26
|
+
green.toString(16).padStart(2, '0') +
|
|
27
|
+
blue.toString(16).padStart(2, '0');
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
red: red,
|
|
31
|
+
green: green,
|
|
32
|
+
blue: blue,
|
|
33
|
+
hex: hex.toUpperCase(),
|
|
34
|
+
};
|
|
33
35
|
}
|
|
34
36
|
export function handleFn(functionName, recordDxf, entity, group, key, configParams, konvaLayer) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
console.log(functionName);
|
|
38
|
+
|
|
39
|
+
switch (functionName) {
|
|
40
|
+
case 'LINE':
|
|
41
|
+
drawLine(recordDxf, entity, group, key, configParams);
|
|
42
|
+
break;
|
|
43
|
+
case 'TEXT':
|
|
44
|
+
drawText(recordDxf, entity, group, key, configParams);
|
|
45
|
+
break;
|
|
46
|
+
case 'LWPOLYLINE':
|
|
47
|
+
drawLwLine(recordDxf, entity, group, key, configParams);
|
|
48
|
+
break;
|
|
49
|
+
case 'ARC':
|
|
50
|
+
drawArc(recordDxf, entity, group, key, configParams);
|
|
51
|
+
break;
|
|
52
|
+
case 'CIRCLE':
|
|
53
|
+
drawArc(recordDxf, entity, group, key, configParams);
|
|
54
|
+
break;
|
|
55
|
+
case 'ELLIPSE':
|
|
56
|
+
drawEllpse(recordDxf, entity, group, key, configParams);
|
|
57
|
+
break;
|
|
58
|
+
case 'HATCH':
|
|
59
|
+
drawHatch(recordDxf, entity, group, key, configParams);
|
|
60
|
+
break;
|
|
61
|
+
//case 'MTEXT': drawMtext(recordDxf, entity, group, key, configParams)
|
|
62
|
+
//break;
|
|
63
|
+
case 'SPLINE':
|
|
64
|
+
drawSpline(recordDxf, entity, group, key, configParams);
|
|
65
|
+
break;
|
|
66
|
+
// case 'INSERT': drawInsert(recordDxf, entity, group, key, configParams, konvaLayer)
|
|
67
|
+
// break;
|
|
68
|
+
}
|
|
59
69
|
}
|
|
60
|
-
export function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
70
|
+
export function formatEntity(entities) {
|
|
71
|
+
var obj = {};
|
|
72
|
+
for (let i = 0; i < entities.length; i++) {
|
|
73
|
+
if (obj.hasOwnProperty(entities[i].layer)) {
|
|
74
|
+
obj[entities[i].layer].push(entities[i]);
|
|
75
|
+
} else {
|
|
76
|
+
obj[entities[i].layer] = [];
|
|
77
|
+
obj[entities[i].layer].push(entities[i]);
|
|
69
78
|
}
|
|
70
|
-
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
71
81
|
}
|
|
72
82
|
export function getAbsolutePoints(points) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
let x = 0;
|
|
84
|
+
let y = 0;
|
|
85
|
+
points.forEach((point, index) => {
|
|
86
|
+
if (index % 2 === 0) {
|
|
87
|
+
x = x + point;
|
|
88
|
+
} else {
|
|
89
|
+
y = y + point;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
x: Math.ceil(x / (points.length / 2)),
|
|
94
|
+
y: Math.ceil(y / (points.length / 2)),
|
|
95
|
+
};
|
|
86
96
|
}
|
|
87
97
|
export function getColors() {
|
|
88
|
-
|
|
98
|
+
return colors;
|
|
89
99
|
}
|
|
90
100
|
// 居中定位
|
|
91
101
|
export function centering(obj, container, konvaStage, scaleBy) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
computedCenter(p.x, p.y, container, konvaStage, scaleBy)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
102
|
+
// 由于图纸结构解析的变更 可能最外层的group x y 都是0所以 需要拿到x y有值的group
|
|
103
|
+
const filterGroup = obj.filter(item => item.attrs.isGroup && !item.attrs.isMix);
|
|
104
|
+
if (filterGroup.length > 0) {
|
|
105
|
+
if (filterGroup[0].attrs.hasOwnProperty('isBlock') && filterGroup[0].attrs.isBlock) {
|
|
106
|
+
computedCenter(
|
|
107
|
+
filterGroup[0].attrs.x,
|
|
108
|
+
filterGroup[0].attrs.y,
|
|
109
|
+
container,
|
|
110
|
+
konvaStage,
|
|
111
|
+
scaleBy
|
|
112
|
+
);
|
|
106
113
|
} else {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
const target = obj.filter(item => !item.attrs.isGroup);
|
|
115
|
+
if (target[0].className === 'Text') {
|
|
116
|
+
computedCenter(target[0].x(), target[0].y(), container, konvaStage, scaleBy);
|
|
117
|
+
} else if (target[0].className === 'Line') {
|
|
118
|
+
const p = getAbsolutePoints(target[0].getPoints());
|
|
119
|
+
computedCenter(p.x, p.y, container, konvaStage, scaleBy);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
const target = obj.filter(item => !item.attrs.isGroup);
|
|
124
|
+
if (target[0].className === 'Text') {
|
|
125
|
+
computedCenter(target[0].x(), target[0].y(), container, konvaStage, scaleBy);
|
|
126
|
+
} else if (target[0].className === 'Line') {
|
|
127
|
+
const p = getAbsolutePoints(target[0].getPoints());
|
|
128
|
+
computedCenter(p.x, p.y, container, konvaStage, scaleBy);
|
|
114
129
|
}
|
|
130
|
+
}
|
|
115
131
|
}
|
|
116
132
|
// 计算居中位置
|
|
117
133
|
function computedCenter(x, y, container, konvaStage, scaleBy) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
134
|
+
let newX = container.clientWidth / 2 - x * scaleBy;
|
|
135
|
+
let newY = container.clientHeight / 2 - y * scaleBy;
|
|
136
|
+
konvaStage.position({ x: newX, y: newY });
|
|
121
137
|
}
|
|
122
138
|
|
|
123
|
-
function getBSplinePolyline(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
const segmentTs = [knots[degree]];
|
|
135
|
-
const domain = [knots[degree], knots[knots.length - 1 - degree]];
|
|
136
|
-
for (let k = degree + 1; k < knots.length - degree; ++k) {
|
|
137
|
-
if (segmentTs[segmentTs.length - 1] !== knots[k]) {
|
|
138
|
-
segmentTs.push(knots[k]);
|
|
139
|
-
}
|
|
139
|
+
function getBSplinePolyline(controlPoints, degree, knots, interpolationsPerSplineSegment, weights) {
|
|
140
|
+
const polyline = [];
|
|
141
|
+
const controlPointsForLib = controlPoints.map(function (p) {
|
|
142
|
+
return [p.x, p.y];
|
|
143
|
+
});
|
|
144
|
+
const segmentTs = [knots[degree]];
|
|
145
|
+
const domain = [knots[degree], knots[knots.length - 1 - degree]];
|
|
146
|
+
for (let k = degree + 1; k < knots.length - degree; ++k) {
|
|
147
|
+
if (segmentTs[segmentTs.length - 1] !== knots[k]) {
|
|
148
|
+
segmentTs.push(knots[k]);
|
|
140
149
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
}
|
|
151
|
+
interpolationsPerSplineSegment = interpolationsPerSplineSegment || 25;
|
|
152
|
+
for (let i = 1; i < segmentTs.length; ++i) {
|
|
153
|
+
const uMin = segmentTs[i - 1];
|
|
154
|
+
const uMax = segmentTs[i];
|
|
155
|
+
for (let k = 0; k <= interpolationsPerSplineSegment; ++k) {
|
|
156
|
+
const u = (k / interpolationsPerSplineSegment) * (uMax - uMin) + uMin;
|
|
157
|
+
let t = (u - domain[0]) / (domain[1] - domain[0]);
|
|
158
|
+
t = Math.max(t, 0);
|
|
159
|
+
t = Math.min(t, 1);
|
|
160
|
+
const p = bSpline(t, degree, controlPointsForLib, knots, weights);
|
|
161
|
+
polyline.push(new THREE.Vector2(p[0], p[1]));
|
|
153
162
|
}
|
|
154
|
-
|
|
163
|
+
}
|
|
164
|
+
return polyline;
|
|
155
165
|
}
|
|
156
|
-
function mtextContentAndFormattingToTextAndStyle(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var nestedFormat = mtextContentAndFormattingToTextAndStyle(
|
|
182
|
-
item,
|
|
183
|
-
entity,
|
|
184
|
-
configParams
|
|
185
|
-
);
|
|
186
|
-
text.push(nestedFormat.text);
|
|
187
|
-
} else if (typeof item === "object") {
|
|
188
|
-
if (item["S"] && item["S"].length === 3) {
|
|
189
|
-
text.push(item["S"][0] + "/" + item["S"][2]);
|
|
190
|
-
} else {
|
|
191
|
-
// not yet supported.
|
|
192
|
-
}
|
|
193
|
-
}
|
|
166
|
+
function mtextContentAndFormattingToTextAndStyle(textAndControlChars, entity, configParams) {
|
|
167
|
+
let activeStyle = {
|
|
168
|
+
horizontalAlignment: 'left',
|
|
169
|
+
textHeight: entity.height,
|
|
170
|
+
};
|
|
171
|
+
var text = [];
|
|
172
|
+
for (let item of textAndControlChars) {
|
|
173
|
+
if (typeof item === 'string') {
|
|
174
|
+
if (item.startsWith('pxq') && item.endsWith(';')) {
|
|
175
|
+
if (item.indexOf('c') !== -1) activeStyle.horizontalAlignment = 'center';
|
|
176
|
+
else if (item.indexOf('l') !== -1) activeStyle.horizontalAlignment = 'left';
|
|
177
|
+
else if (item.indexOf('r') !== -1) activeStyle.horizontalAlignment = 'right';
|
|
178
|
+
else if (item.indexOf('j') !== -1) activeStyle.horizontalAlignment = 'justify';
|
|
179
|
+
} else {
|
|
180
|
+
text.push(item);
|
|
181
|
+
}
|
|
182
|
+
} else if (Array.isArray(item)) {
|
|
183
|
+
var nestedFormat = mtextContentAndFormattingToTextAndStyle(item, entity, configParams);
|
|
184
|
+
text.push(nestedFormat.text);
|
|
185
|
+
} else if (typeof item === 'object') {
|
|
186
|
+
if (item['S'] && item['S'].length === 3) {
|
|
187
|
+
text.push(item['S'][0] + '/' + item['S'][2]);
|
|
188
|
+
} else {
|
|
189
|
+
// not yet supported.
|
|
190
|
+
}
|
|
194
191
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
text: text.join(),
|
|
195
|
+
style: activeStyle,
|
|
196
|
+
};
|
|
199
197
|
}
|
|
200
198
|
|
|
201
199
|
function drawArc(recordDxf, entity, group, key, configParams) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
// group.add(line);
|
|
200
|
+
let color = entity.color;
|
|
201
|
+
let rgb = decimalToRGBHex(color);
|
|
202
|
+
console.log(rgb);
|
|
203
|
+
let hex = rgb.hex;
|
|
204
|
+
let startAngle, endAngle;
|
|
205
|
+
if (entity.type === 'CIRCLE') {
|
|
206
|
+
startAngle = entity.startAngle || 0;
|
|
207
|
+
endAngle = startAngle + 2 * Math.PI;
|
|
208
|
+
} else {
|
|
209
|
+
startAngle = entity.startAngle;
|
|
210
|
+
endAngle = entity.endAngle;
|
|
211
|
+
}
|
|
212
|
+
let curve = new THREE.ArcCurve(
|
|
213
|
+
entity.center.x,
|
|
214
|
+
parseFloat(entity.center.y),
|
|
215
|
+
entity.radius,
|
|
216
|
+
startAngle,
|
|
217
|
+
endAngle
|
|
218
|
+
);
|
|
219
|
+
let points = curve.getPoints(32);
|
|
220
|
+
|
|
221
|
+
let list = [];
|
|
222
|
+
for (let i = 0; i < points.length; i++) {
|
|
223
|
+
list.push(points[i].x);
|
|
224
|
+
list.push(-parseFloat(points[i].y));
|
|
225
|
+
}
|
|
226
|
+
let width = 0.2;
|
|
227
|
+
group.push({
|
|
228
|
+
type: 'polyline',
|
|
229
|
+
points: list,
|
|
230
|
+
name: key.replace(/\s*/g, ''),
|
|
231
|
+
entityId: key,
|
|
232
|
+
stroke: hex,
|
|
233
|
+
customColor: configParams ? configParams.color : '',
|
|
234
|
+
strokeWidth: width,
|
|
235
|
+
visible: configParams ? configParams.visible : true,
|
|
236
|
+
oldstrokeLength: width,
|
|
237
|
+
});
|
|
238
|
+
// if(group.attrs.isBlock){
|
|
239
|
+
// let scale=group.scale();
|
|
240
|
+
// width=width/Math.abs(scale.x);
|
|
241
|
+
// }
|
|
242
|
+
// let line = new Konva.Line({
|
|
243
|
+
// name: key.replace(/\s*/g, ""),
|
|
244
|
+
// entityId: key,
|
|
245
|
+
// isGroup: false,
|
|
246
|
+
// points: list,
|
|
247
|
+
// stroke: configParams ? configParams.color : "#000",
|
|
248
|
+
// customColor: configParams ? configParams.color : "",
|
|
249
|
+
// strokeWidth: width,
|
|
250
|
+
// lineCap: "round",
|
|
251
|
+
// lineJoin: "round",
|
|
252
|
+
// visible: configParams ? configParams.visible :true,
|
|
253
|
+
// oldstrokeLength:width
|
|
254
|
+
// });
|
|
255
|
+
// group.add(line);
|
|
259
256
|
}
|
|
260
257
|
|
|
261
258
|
function drawEllpse(recordDxf, entity, group, key, configParams) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
// });
|
|
318
|
-
// group.add(line);
|
|
259
|
+
let xrad = Math.sqrt(
|
|
260
|
+
Math.pow(parseFloat(entity.majorAxisEndPoint.x), 2) +
|
|
261
|
+
Math.pow(parseFloat(entity.majorAxisEndPoint.y), 2)
|
|
262
|
+
);
|
|
263
|
+
let yrad = xrad * parseFloat(entity.axisRatio);
|
|
264
|
+
let rotation = Math.atan2(
|
|
265
|
+
parseFloat(entity.majorAxisEndPoint.y),
|
|
266
|
+
parseFloat(entity.majorAxisEndPoint.x)
|
|
267
|
+
);
|
|
268
|
+
console.log(entity.startAngle);
|
|
269
|
+
console.log(entity.endAngle);
|
|
270
|
+
let curve = new THREE.EllipseCurve(
|
|
271
|
+
parseFloat(entity.center.x),
|
|
272
|
+
parseFloat(entity.center.y),
|
|
273
|
+
xrad,
|
|
274
|
+
yrad,
|
|
275
|
+
parseFloat(entity.startAngle),
|
|
276
|
+
parseFloat(entity.endAngle),
|
|
277
|
+
false, // Always counterclockwise
|
|
278
|
+
rotation
|
|
279
|
+
);
|
|
280
|
+
let points = curve.getPoints(200);
|
|
281
|
+
let list = [];
|
|
282
|
+
for (let i = 0; i < points.length; i++) {
|
|
283
|
+
list.push(points[i].x);
|
|
284
|
+
list.push(-parseFloat(points[i].y));
|
|
285
|
+
}
|
|
286
|
+
let width = 0.2;
|
|
287
|
+
|
|
288
|
+
group.push({
|
|
289
|
+
type: 'polyline',
|
|
290
|
+
points: list,
|
|
291
|
+
name: key.replace(/\s*/g, ''),
|
|
292
|
+
entityId: key,
|
|
293
|
+
stroke: configParams ? configParams.color : '#000',
|
|
294
|
+
customColor: configParams ? configParams.color : '',
|
|
295
|
+
strokeWidth: width,
|
|
296
|
+
visible: configParams ? configParams.visible : true,
|
|
297
|
+
oldstrokeLength: width,
|
|
298
|
+
});
|
|
299
|
+
// let line = new Konva.Line({
|
|
300
|
+
// name: key.replace(/\s*/g, ""),
|
|
301
|
+
// entityId: key,
|
|
302
|
+
// isGroup: false,
|
|
303
|
+
// points: list,
|
|
304
|
+
// stroke: configParams ? configParams.color : "#000",
|
|
305
|
+
// customColor: configParams ? configParams.color : "",
|
|
306
|
+
// strokeWidth: width,
|
|
307
|
+
// lineCap: "round",
|
|
308
|
+
// lineJoin: "round",
|
|
309
|
+
// visible: configParams ? configParams.visible : true,
|
|
310
|
+
// oldstrokeLength:width
|
|
311
|
+
|
|
312
|
+
// });
|
|
313
|
+
// group.add(line);
|
|
319
314
|
}
|
|
320
315
|
function drawLine(recordDxf, entity, group, key, configParams) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
316
|
+
let color = entity.color;
|
|
317
|
+
let rgb = decimalToRGBHex(color);
|
|
318
|
+
console.log(rgb);
|
|
319
|
+
let hex = rgb.hex;
|
|
320
|
+
let x1 = entity.vertices[0].x;
|
|
321
|
+
let y1 = entity.vertices[0].y;
|
|
322
|
+
let x2 = entity.vertices[1].x;
|
|
323
|
+
let y2 = entity.vertices[1].y;
|
|
324
|
+
let width = 0.2;
|
|
325
|
+
group.push({
|
|
326
|
+
type: 'line',
|
|
327
|
+
x1: x1,
|
|
328
|
+
x2: x2,
|
|
329
|
+
y1: y1,
|
|
330
|
+
y2: y2,
|
|
331
|
+
name: key.replace(/\s*/g, ''),
|
|
332
|
+
entityId: key,
|
|
333
|
+
isGroup: false,
|
|
334
|
+
stroke: hex,
|
|
335
|
+
customColor: configParams ? configParams.color : '',
|
|
336
|
+
strokeWidth: width,
|
|
337
|
+
visible: configParams ? configParams.visible : true,
|
|
338
|
+
oldstrokeLength: width,
|
|
339
|
+
});
|
|
340
|
+
// if(group.attrs.isBlock){
|
|
341
|
+
// let scale=group.scale();
|
|
342
|
+
// width=width/Math.abs(scale.x);
|
|
343
|
+
// }
|
|
344
|
+
// let line = new Konva.Line({
|
|
345
|
+
// name: key.replace(/\s*/g, ""),
|
|
346
|
+
// entityId: key,
|
|
347
|
+
// isGroup: false,
|
|
348
|
+
// points: [x1, -parseFloat(y1), parseFloat(x2), -parseFloat(y2)],
|
|
349
|
+
// stroke: configParams ? configParams.color : "#000",
|
|
350
|
+
// customColor: configParams ? configParams.color : "",
|
|
351
|
+
// strokeWidth: width,
|
|
352
|
+
// //lineCap: "round",
|
|
353
|
+
// //lineJoin: "round",
|
|
354
|
+
// visible: configParams ? configParams.visible : true,
|
|
355
|
+
// oldstrokeLength:width,
|
|
356
|
+
// handle:entity.handle
|
|
357
|
+
|
|
358
|
+
// });
|
|
359
|
+
|
|
360
|
+
// group.add(line);
|
|
366
361
|
}
|
|
367
|
-
function drawText(recordDxf, entity, group, key, configParams) {
|
|
368
|
-
let color=entity.color;
|
|
369
|
-
let rgb=decimalToRGBHex(color);
|
|
370
|
-
console.log(rgb);
|
|
371
|
-
let hex=rgb.hex;
|
|
372
362
|
|
|
373
|
-
|
|
374
|
-
|
|
363
|
+
function drawText(recordDxf, entity, group, key, configParams) {
|
|
364
|
+
let color = entity.color;
|
|
365
|
+
let rgb = decimalToRGBHex(color);
|
|
366
|
+
console.log(rgb);
|
|
367
|
+
let hex = rgb.hex;
|
|
368
|
+
|
|
369
|
+
if (hex == '#FFFFFF') {
|
|
370
|
+
hex = '#000';
|
|
371
|
+
}
|
|
372
|
+
let text = entity.text;
|
|
373
|
+
const fontSize = entity.textHeight;
|
|
374
|
+
|
|
375
|
+
// 与 AutoCAD TEXT 一致:绕插入点对齐锚点旋转;Y 轴翻转后角度用 360°-θ
|
|
376
|
+
const insert =
|
|
377
|
+
entity.endPoint && (entity.halign !== undefined || entity.valign !== undefined)
|
|
378
|
+
? entity.endPoint
|
|
379
|
+
: entity.startPoint;
|
|
380
|
+
|
|
381
|
+
const dim = new Konva.Text({
|
|
382
|
+
x: 0,
|
|
383
|
+
y: 0,
|
|
384
|
+
text: text,
|
|
385
|
+
fontSize: fontSize,
|
|
386
|
+
align: 'left',
|
|
387
|
+
verticalAlign: 'top',
|
|
388
|
+
fill: hex,
|
|
389
|
+
customColor: configParams ? configParams.color : '',
|
|
390
|
+
name: key.replace(/\s*/g, ''),
|
|
391
|
+
entityId: key,
|
|
392
|
+
fontFamily: 'SimSun',
|
|
393
|
+
visible: configParams ? configParams.visible : true,
|
|
394
|
+
stroke: hex,
|
|
395
|
+
strokeWidth: 0.1,
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
if (entity.xScale) {
|
|
399
|
+
dim.scaleX(entity.xScale);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
const tw = dim.width();
|
|
403
|
+
const th = dim.height();
|
|
404
|
+
const lh = dim.lineHeight() || 1;
|
|
405
|
+
// 用字体度量计算锚点,避免 valign=2(中线) 与 baseline 近似重合
|
|
406
|
+
let ascent = fontSize * lh * 0.8;
|
|
407
|
+
let descent = fontSize * lh * 0.2;
|
|
408
|
+
try {
|
|
409
|
+
const metrics = dim.measureSize(text || 'M');
|
|
410
|
+
const mAscent = metrics?.fontBoundingBoxAscent ?? metrics?.actualBoundingBoxAscent;
|
|
411
|
+
const mDescent = metrics?.fontBoundingBoxDescent ?? metrics?.actualBoundingBoxDescent;
|
|
412
|
+
if (typeof mAscent === 'number' && mAscent > 0) {
|
|
413
|
+
ascent = mAscent;
|
|
375
414
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if(key==0){
|
|
379
|
-
fontSize=entity.textHeight+0.35;
|
|
380
|
-
}else{
|
|
381
|
-
fontSize=entity.textHeight+0.35;
|
|
415
|
+
if (typeof mDescent === 'number' && mDescent >= 0) {
|
|
416
|
+
descent = mDescent;
|
|
382
417
|
}
|
|
418
|
+
} catch (e) {
|
|
419
|
+
// ignore
|
|
420
|
+
}
|
|
421
|
+
const baselineOffset = ascent;
|
|
422
|
+
|
|
423
|
+
const halign = entity.halign != null ? Number(entity.halign) : 0;
|
|
424
|
+
const valign = entity.valign != null ? Number(entity.valign) : 0;
|
|
425
|
+
|
|
426
|
+
let anchorX = 0;
|
|
427
|
+
if (halign === 1 || halign === 4) {
|
|
428
|
+
anchorX = tw / 2;
|
|
429
|
+
} else if (halign === 2) {
|
|
430
|
+
anchorX = tw;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
let anchorY = baselineOffset;
|
|
434
|
+
if (valign === 3) {
|
|
435
|
+
anchorY = 0;
|
|
436
|
+
} else if (valign === 2) {
|
|
437
|
+
// DXF Middle: 使用字形上下边界中心,而不是 Konva 文本框中心
|
|
438
|
+
anchorY = (ascent + descent) / 2;
|
|
439
|
+
} else if (valign === 1) {
|
|
440
|
+
anchorY = ascent + descent;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
dim.x(-anchorX);
|
|
444
|
+
dim.y(-anchorY);
|
|
445
|
+
|
|
446
|
+
const rotation = Number(entity.rotation || 0);
|
|
447
|
+
const g = new Konva.Group({
|
|
448
|
+
x: parseFloat(insert.x),
|
|
449
|
+
y: -parseFloat(insert.y),
|
|
450
|
+
rotation: 360 - rotation,
|
|
451
|
+
name: key.replace(/\s*/g, ''),
|
|
452
|
+
entityId: key,
|
|
453
|
+
visible: configParams ? configParams.visible : true,
|
|
454
|
+
customColor: configParams ? configParams.color : '',
|
|
455
|
+
});
|
|
456
|
+
g.add(dim);
|
|
457
|
+
|
|
458
|
+
group.push({
|
|
459
|
+
type: 'text',
|
|
460
|
+
obj: g,
|
|
461
|
+
});
|
|
462
|
+
// group.add(dim);
|
|
463
|
+
}
|
|
383
464
|
|
|
465
|
+
function drawHatch(recordDxf, entity, group, key, configParams) {
|
|
466
|
+
console.log('hatch');
|
|
467
|
+
}
|
|
384
468
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
469
|
+
function drawLwLine(recordDxf, entity, group, key, configParams) {
|
|
470
|
+
let color = entity.color;
|
|
471
|
+
let rgb = decimalToRGBHex(color);
|
|
472
|
+
console.log(rgb);
|
|
473
|
+
let hex = rgb.hex;
|
|
474
|
+
|
|
475
|
+
if (hex == '#FFFFFF') {
|
|
476
|
+
hex = '#000';
|
|
477
|
+
}
|
|
478
|
+
let closed = entity.shape;
|
|
479
|
+
let list = [];
|
|
480
|
+
for (let i = 0; i < entity.vertices.length; i++) {
|
|
481
|
+
list.push(entity.vertices[i].x);
|
|
482
|
+
list.push(-parseFloat(entity.vertices[i].y));
|
|
483
|
+
}
|
|
484
|
+
let width = 0.2;
|
|
485
|
+
if (entity.width) {
|
|
486
|
+
width = width + parseFloat(entity.width);
|
|
487
|
+
} else {
|
|
488
|
+
width = 0.2;
|
|
489
|
+
}
|
|
490
|
+
group.push({
|
|
491
|
+
type: 'polyline',
|
|
492
|
+
points: list,
|
|
493
|
+
closed: closed,
|
|
494
|
+
name: key.replace(/\s*/g, ''),
|
|
495
|
+
entityId: key,
|
|
496
|
+
stroke: hex,
|
|
497
|
+
customColor: configParams ? configParams.color : '',
|
|
498
|
+
strokeWidth: width,
|
|
499
|
+
visible: configParams ? configParams.visible : true,
|
|
500
|
+
oldstrokeLength: width,
|
|
501
|
+
});
|
|
502
|
+
// let line = new Konva.Line({
|
|
503
|
+
// name: key.replace(/\s*/g, ""),
|
|
504
|
+
// entityId: key,
|
|
505
|
+
// isGroup: false,
|
|
506
|
+
// points: list,
|
|
507
|
+
// stroke: configParams ? configParams.color : "#000",
|
|
508
|
+
// customColor: configParams ? configParams.color : "",
|
|
509
|
+
// strokeWidth: width,
|
|
510
|
+
// visible: configParams ? configParams.visible : true,
|
|
511
|
+
// closed:closed,
|
|
512
|
+
// oldstrokeLength:width,
|
|
513
|
+
// handle:entity.handle
|
|
514
|
+
|
|
515
|
+
// });
|
|
516
|
+
// group.add(line);
|
|
517
|
+
}
|
|
518
|
+
function drawSpline(recordDxf, entity, group, key, configParams) {
|
|
519
|
+
let points = getBSplinePolyline(
|
|
520
|
+
entity.controlPoints,
|
|
521
|
+
entity.degreeOfSplineCurve,
|
|
522
|
+
entity.knotValues,
|
|
523
|
+
100
|
|
524
|
+
);
|
|
525
|
+
let list = [];
|
|
526
|
+
for (let i = 0; i < points.length; i++) {
|
|
527
|
+
list.push(points[i].x);
|
|
528
|
+
list.push(-parseFloat(points[i].y));
|
|
529
|
+
}
|
|
530
|
+
let width = 0.1;
|
|
531
|
+
group.push({
|
|
532
|
+
type: 'polyline',
|
|
533
|
+
points: list,
|
|
534
|
+
name: key.replace(/\s*/g, ''),
|
|
535
|
+
entityId: key,
|
|
536
|
+
isGroup: false,
|
|
537
|
+
stroke: configParams ? configParams : '#000',
|
|
538
|
+
customColor: configParams ? configParams.color : '',
|
|
539
|
+
strokeWidth: width,
|
|
540
|
+
visible: configParams ? configParams.visible : true,
|
|
541
|
+
oldstrokeLength: width,
|
|
542
|
+
});
|
|
543
|
+
// let line = new Konva.Line({
|
|
544
|
+
// name: key.replace(/\s*/g, ""),
|
|
545
|
+
// entityId: key,
|
|
546
|
+
// isGroup: false,
|
|
547
|
+
// points: list,
|
|
548
|
+
// stroke: configParams ? configParams : "#000",
|
|
549
|
+
// customColor: configParams ? configParams.color : "",
|
|
550
|
+
// strokeWidth: width,
|
|
551
|
+
// lineCap: "round",
|
|
552
|
+
// lineJoin: "round",
|
|
553
|
+
// visible: configParams ? configParams.visible : true,
|
|
554
|
+
// oldstrokeLength:width
|
|
555
|
+
// });
|
|
556
|
+
// group.add(line);
|
|
557
|
+
}
|
|
558
|
+
function drawInsert(recordDxf, entities, group, key, configParams, konvaLayer) {
|
|
559
|
+
if (recordDxf.blocks[entities.name]) {
|
|
560
|
+
let group2 = new Konva.Group({
|
|
561
|
+
x: 0,
|
|
562
|
+
y: 0,
|
|
563
|
+
name: key.replace(/\s*/g, ''),
|
|
564
|
+
isBlock: true,
|
|
565
|
+
blockName: entities.name,
|
|
566
|
+
entityId: key,
|
|
567
|
+
isGroup: true,
|
|
568
|
+
visible: true,
|
|
401
569
|
});
|
|
402
|
-
let
|
|
403
|
-
|
|
404
|
-
//let clientWidth=clientRect.width;
|
|
405
|
-
|
|
406
|
-
if(entity.halign){
|
|
407
|
-
if(entity.halign==1){
|
|
408
|
-
dim.attrs.x= dim.attrs.x-(width/2);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
|
|
570
|
+
let entity = entities;
|
|
571
|
+
let block = recordDxf.blocks[entities.name];
|
|
413
572
|
if (entity.rotation) {
|
|
414
|
-
|
|
415
|
-
dim.attrs.x = parseFloat(x) - fontSize;
|
|
416
|
-
}
|
|
417
|
-
if(entity.rotation==270||parseInt(entity.rotation)==270)
|
|
418
|
-
{
|
|
419
|
-
dim.attrs.x = parseFloat(x) + fontSize;
|
|
420
|
-
}
|
|
421
|
-
if(entity.rotation==180||parseInt(entity.rotation)==180){
|
|
422
|
-
dim.attrs.y= -parseFloat(y) - fontSize;
|
|
423
|
-
}
|
|
424
|
-
if(entity.rotation==360||parseFloat(entity.rotation)==360){
|
|
425
|
-
dim.attrs.y= -parseFloat(y) - fontSize;
|
|
426
|
-
}
|
|
427
|
-
if(parseInt(entity.rotation)==30||parseInt(entity.rotation)==29) {
|
|
428
|
-
//dim.attrs.x= parseFloat(x) -200;
|
|
429
|
-
|
|
430
|
-
//console.log("rect");
|
|
431
|
-
//console.log(rect);
|
|
432
|
-
dim.attrs.y= -parseFloat(y) - fontSize*0.85;
|
|
433
|
-
dim.attrs.x = parseFloat(x) - fontSize*0.85;
|
|
434
|
-
if(text.length>9){
|
|
435
|
-
let width=dim.getTextWidth()
|
|
436
|
-
//let clientRect=dim.getClientRect()
|
|
437
|
-
//let clientWidth=clientRect.width;
|
|
438
|
-
dim.attrs.y= -parseFloat(y) +fontSize;
|
|
439
|
-
if(entity.halign){
|
|
440
|
-
if(entity.halign==1){
|
|
441
|
-
dim.attrs.x= dim.attrs.x-(width/2);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
if (entity.valign === 3) { // Middle
|
|
446
|
-
dim.attrs.x= dim.attrs.x+1;
|
|
447
|
-
dim.attrs.y = -parseFloat(y) +fontSize*1.8 ;
|
|
448
|
-
}
|
|
449
|
-
}else{
|
|
450
|
-
if (entity.valign === 3) { // Middle
|
|
451
|
-
dim.attrs.x= dim.attrs.x+1;
|
|
452
|
-
dim.attrs.y = -parseFloat(y) ;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if(parseInt(entity.rotation)==330||parseInt(entity.rotation)==329) {
|
|
457
|
-
//dim.attrs.x= parseFloat(x) -200;
|
|
458
|
-
|
|
459
|
-
//console.log("rect");
|
|
460
|
-
//console.log(rect);
|
|
461
|
-
dim.attrs.y= -parseFloat(y) -fontSize;
|
|
462
|
-
dim.attrs.x = parseFloat(x) +0.5;
|
|
463
|
-
}
|
|
464
|
-
if(parseInt(entity.rotation)==60||parseInt(entity.rotation)==60) {
|
|
465
|
-
//dim.attrs.x= parseFloat(x) -200;
|
|
466
|
-
|
|
467
|
-
//console.log("rect");
|
|
468
|
-
//console.log(rect);
|
|
469
|
-
dim.attrs.y= -parseFloat(y) ;
|
|
470
|
-
dim.attrs.x = parseFloat(x) -fontSize;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
// dim.attrs.y= -parseFloat(y)+ fontSize*0.8;
|
|
475
|
-
|
|
476
|
-
dim.attrs.rotation = 360-entity.rotation ;
|
|
477
|
-
|
|
478
|
-
}else{
|
|
479
|
-
|
|
480
|
-
// 支持 DXF 垂直对齐(valign),仅在未旋转时按插入点对齐
|
|
481
|
-
if (entity.valign === 2) { // Middle
|
|
482
|
-
dim.attrs.y = -parseFloat(y) - fontSize / 2;
|
|
483
|
-
} else if (entity.valign === 3) { // Top
|
|
484
|
-
dim.attrs.y = -parseFloat(y);
|
|
485
|
-
} else { // Baseline / Bottom 或未设置,保持原逻辑
|
|
486
|
-
dim.attrs.y = -parseFloat(y) - fontSize;
|
|
487
|
-
}
|
|
573
|
+
group2.rotation(360 - entity.rotation);
|
|
488
574
|
}
|
|
575
|
+
|
|
489
576
|
if (entity.xScale) {
|
|
490
|
-
|
|
577
|
+
group2.scale({ x: entity.xScale, y: entity.yScale });
|
|
491
578
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
//dim.attrs.x= dim.attrs.x-parseFloat(2);
|
|
496
|
-
group.push({
|
|
497
|
-
"type":'text',
|
|
498
|
-
'obj':dim,
|
|
499
|
-
})
|
|
500
|
-
// group.add(dim);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
function drawHatch(recordDxf,entity,group,key,configParams){
|
|
504
|
-
|
|
505
|
-
console.log("hatch");
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
function drawLwLine(recordDxf, entity, group, key, configParams) {
|
|
509
|
-
let color=entity.color;
|
|
510
|
-
let rgb=decimalToRGBHex(color);
|
|
511
|
-
console.log(rgb);
|
|
512
|
-
let hex=rgb.hex;
|
|
513
|
-
|
|
514
|
-
if(hex=='#FFFFFF'){
|
|
515
|
-
hex='#000';
|
|
579
|
+
if (entity.yScale) {
|
|
580
|
+
group2.scale({ x: entity.xScale, y: entity.yScale });
|
|
516
581
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
list.push(entity.vertices[i].x);
|
|
521
|
-
list.push(-parseFloat(entity.vertices[i].y));
|
|
582
|
+
if (entity.position) {
|
|
583
|
+
group2.attrs.x = parseFloat(entity.position.x);
|
|
584
|
+
group2.attrs.y = -parseFloat(entity.position.y);
|
|
522
585
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
586
|
+
if (entity.position.x < 0) {
|
|
587
|
+
group2.attrs.x = parseFloat(entity.position.x) * -1;
|
|
588
|
+
if (entity.xScale < 0) {
|
|
589
|
+
group2.scale({ x: Math.abs(entity.xScale), y: entity.yScale });
|
|
590
|
+
}
|
|
528
591
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
points:list,
|
|
532
|
-
closed:closed,
|
|
533
|
-
name: key.replace(/\s*/g, ""),
|
|
534
|
-
entityId: key,
|
|
535
|
-
stroke: hex,
|
|
536
|
-
customColor: configParams ? configParams.color : "",
|
|
537
|
-
strokeWidth: width,
|
|
538
|
-
visible: configParams ? configParams.visible : true,
|
|
539
|
-
oldstrokeLength:width,
|
|
540
|
-
})
|
|
541
|
-
// let line = new Konva.Line({
|
|
542
|
-
// name: key.replace(/\s*/g, ""),
|
|
543
|
-
// entityId: key,
|
|
544
|
-
// isGroup: false,
|
|
545
|
-
// points: list,
|
|
546
|
-
// stroke: configParams ? configParams.color : "#000",
|
|
547
|
-
// customColor: configParams ? configParams.color : "",
|
|
548
|
-
// strokeWidth: width,
|
|
549
|
-
// visible: configParams ? configParams.visible : true,
|
|
550
|
-
// closed:closed,
|
|
551
|
-
// oldstrokeLength:width,
|
|
552
|
-
// handle:entity.handle
|
|
553
|
-
|
|
554
|
-
// });
|
|
555
|
-
// group.add(line);
|
|
556
|
-
}
|
|
557
|
-
function drawSpline(recordDxf, entity, group, key, configParams) {
|
|
558
|
-
let points = getBSplinePolyline(
|
|
559
|
-
entity.controlPoints,
|
|
560
|
-
entity.degreeOfSplineCurve,
|
|
561
|
-
entity.knotValues,
|
|
562
|
-
100
|
|
563
|
-
);
|
|
564
|
-
let list = [];
|
|
565
|
-
for (let i = 0; i < points.length; i++) {
|
|
566
|
-
list.push(points[i].x);
|
|
567
|
-
list.push(-parseFloat(points[i].y));
|
|
592
|
+
if (block.entities == undefined) {
|
|
593
|
+
return;
|
|
568
594
|
}
|
|
569
|
-
let
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
points: list,
|
|
573
|
-
name: key.replace(/\s*/g, ""),
|
|
574
|
-
entityId: key,
|
|
575
|
-
isGroup: false,
|
|
576
|
-
stroke: configParams ? configParams : "#000",
|
|
577
|
-
customColor: configParams ? configParams.color : "",
|
|
578
|
-
strokeWidth: width,
|
|
579
|
-
visible: configParams ? configParams.visible : true,
|
|
580
|
-
oldstrokeLength: width
|
|
581
|
-
});
|
|
582
|
-
// let line = new Konva.Line({
|
|
583
|
-
// name: key.replace(/\s*/g, ""),
|
|
584
|
-
// entityId: key,
|
|
585
|
-
// isGroup: false,
|
|
586
|
-
// points: list,
|
|
587
|
-
// stroke: configParams ? configParams : "#000",
|
|
588
|
-
// customColor: configParams ? configParams.color : "",
|
|
589
|
-
// strokeWidth: width,
|
|
590
|
-
// lineCap: "round",
|
|
591
|
-
// lineJoin: "round",
|
|
592
|
-
// visible: configParams ? configParams.visible : true,
|
|
593
|
-
// oldstrokeLength:width
|
|
594
|
-
// });
|
|
595
|
-
// group.add(line);
|
|
596
|
-
}
|
|
597
|
-
function drawInsert(recordDxf, entities, group, key, configParams, konvaLayer) {
|
|
598
|
-
if (recordDxf.blocks[entities.name]) {
|
|
599
|
-
let group2 = new Konva.Group({
|
|
600
|
-
x: 0,
|
|
601
|
-
y: 0,
|
|
602
|
-
name: key.replace(/\s*/g, ""),
|
|
603
|
-
isBlock: true,
|
|
604
|
-
blockName: entities.name,
|
|
605
|
-
entityId: key,
|
|
606
|
-
isGroup: true,
|
|
607
|
-
visible: true,
|
|
608
|
-
});
|
|
609
|
-
let entity = entities;
|
|
610
|
-
let block = recordDxf.blocks[entities.name];
|
|
611
|
-
if (entity.rotation) {
|
|
612
|
-
group2.rotation(360-entity.rotation);
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
if (entity.xScale) {
|
|
616
|
-
group2.scale({ x: entity.xScale, y: entity.yScale });
|
|
617
|
-
}
|
|
618
|
-
if (entity.yScale) {
|
|
619
|
-
group2.scale({ x: entity.xScale, y: entity.yScale });
|
|
620
|
-
}
|
|
621
|
-
if (entity.position) {
|
|
622
|
-
group2.attrs.x = parseFloat(entity.position.x);
|
|
623
|
-
group2.attrs.y = -parseFloat(entity.position.y);
|
|
624
|
-
}
|
|
625
|
-
if(entity.position.x<0){
|
|
626
|
-
group2.attrs.x = parseFloat(entity.position.x)*-1;
|
|
627
|
-
if(entity.xScale<0){
|
|
628
|
-
group2.scale({ x: Math.abs(entity.xScale), y: entity.yScale });
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
if(block.entities==undefined){
|
|
632
|
-
return ;
|
|
633
|
-
}
|
|
634
|
-
for (let j = 0; j < block.entities.length; j++) {
|
|
635
|
-
let type = block.entities[j].type;
|
|
636
|
-
handleFn(type, recordDxf, block.entities[j], group2, key, configParams, konvaLayer)
|
|
637
|
-
}
|
|
638
|
-
group.add(group2)
|
|
639
|
-
// 区分块 因为有的块里面包含块 不区分会对点击定位有影响
|
|
640
|
-
group.attrs.isMix = true
|
|
641
|
-
konvaLayer.add(group)
|
|
595
|
+
for (let j = 0; j < block.entities.length; j++) {
|
|
596
|
+
let type = block.entities[j].type;
|
|
597
|
+
handleFn(type, recordDxf, block.entities[j], group2, key, configParams, konvaLayer);
|
|
642
598
|
}
|
|
599
|
+
group.add(group2);
|
|
600
|
+
// 区分块 因为有的块里面包含块 不区分会对点击定位有影响
|
|
601
|
+
group.attrs.isMix = true;
|
|
602
|
+
konvaLayer.add(group);
|
|
603
|
+
}
|
|
643
604
|
}
|
|
644
605
|
|
|
645
|
-
let color= [
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
606
|
+
let color = [
|
|
607
|
+
'0,0,0', //1
|
|
608
|
+
'255,0,0', //2
|
|
609
|
+
'255,255,0', //3
|
|
610
|
+
'0,255,0', //4
|
|
611
|
+
'0,255,255', //5
|
|
612
|
+
'0,0,255', //6
|
|
613
|
+
'255,0,255', //7
|
|
614
|
+
'255,255,255', //8
|
|
615
|
+
'128,128,128', //9
|
|
616
|
+
'192,192,192', //10
|
|
617
|
+
'255,0,0', //11
|
|
618
|
+
'255,120,112', //12
|
|
619
|
+
'192,0,0', //13
|
|
620
|
+
'207,103,96', //14
|
|
621
|
+
'144,0,0', //15
|
|
622
|
+
'144,72,79', //16
|
|
623
|
+
'127,0,0', //17
|
|
624
|
+
'112,56,48', //18
|
|
625
|
+
'79,0,0', //19
|
|
626
|
+
'79,39,32', //20
|
|
627
|
+
'255,56,0', //21
|
|
628
|
+
'255,159,127', //22
|
|
629
|
+
'192,48,0', //23
|
|
630
|
+
'207,127,96', //24
|
|
631
|
+
'144,32,0', //25
|
|
632
|
+
'144,88,64', // 26
|
|
633
|
+
'112,24,0', //27
|
|
634
|
+
'127,72,63', //28
|
|
635
|
+
'79,16,0', //29
|
|
636
|
+
'64,40,31', //30
|
|
637
|
+
'255,127,0', //31
|
|
638
|
+
'255,191,127', //32
|
|
639
|
+
'207,103,0', //33
|
|
640
|
+
'192,151,96', //34
|
|
641
|
+
'159,72,0', //35
|
|
642
|
+
'144,112,79', //36
|
|
643
|
+
'127,63,0', //37
|
|
644
|
+
'127,95,63', //38
|
|
645
|
+
'64,32,0', //39
|
|
646
|
+
'64,55,31', //40
|
|
647
|
+
'255,191,0', // 41
|
|
648
|
+
'255,216,127', //42
|
|
649
|
+
'207,152,0', //43
|
|
650
|
+
'192,175,96', //44
|
|
651
|
+
'144,112,0', //45
|
|
652
|
+
'144,128,64', //46
|
|
653
|
+
'112,88,0', //47
|
|
654
|
+
'127,111,63', //48
|
|
655
|
+
'64,55,0', //49
|
|
656
|
+
'64,63,31', //50
|
|
657
|
+
'255,255,0', //51
|
|
658
|
+
'255,255,112', //52
|
|
659
|
+
'207,200,0', //53
|
|
660
|
+
'192,200,96', //54
|
|
661
|
+
'144,151,0', //55
|
|
662
|
+
'144,151,64', //56
|
|
663
|
+
'144,152,0', //57
|
|
664
|
+
'127,120,63', //58
|
|
665
|
+
'79,72,0', //59
|
|
666
|
+
'79,72,32', //60
|
|
667
|
+
'191,255,0', //61
|
|
668
|
+
'208,255,112', //62
|
|
669
|
+
'144,200,0', //63
|
|
670
|
+
'176,200,96', //64
|
|
671
|
+
'111,151,0', //65
|
|
672
|
+
'128,151,79', //66
|
|
673
|
+
'95,127,0', //67
|
|
674
|
+
'111,127,63', //68
|
|
675
|
+
'48,72,0', //69
|
|
676
|
+
'63,72,31', //70
|
|
677
|
+
'127,255,0', //71
|
|
678
|
+
'191,255,127', //72
|
|
679
|
+
'95,200,0', //73
|
|
680
|
+
'159,200,96', //74
|
|
681
|
+
'64,151,0', //75
|
|
682
|
+
'111,151,64', //76
|
|
683
|
+
'63,120,0', //77
|
|
684
|
+
'95,127,63', //78
|
|
685
|
+
'31,72,0', //79
|
|
686
|
+
'48,72,32', //80
|
|
687
|
+
'63,255,0', //81
|
|
688
|
+
'159,255,127', //82
|
|
689
|
+
'47,200,0', //83
|
|
690
|
+
'127,200,96', //84
|
|
691
|
+
'31,151,0', //85
|
|
692
|
+
'80,151,64', //86
|
|
693
|
+
'31,127,0', //87
|
|
694
|
+
'79,127,63', //88
|
|
695
|
+
'15,72,0', //89
|
|
696
|
+
'47,72,32', //90
|
|
697
|
+
'0,255,0', //91
|
|
698
|
+
'127,255,127', //92
|
|
699
|
+
'0,200,0', //93
|
|
700
|
+
'95,200,95', //94
|
|
701
|
+
'0,151,0', //95
|
|
702
|
+
'79,151,79', //96
|
|
703
|
+
'0,127,0', //97
|
|
704
|
+
'63,127,63', //98
|
|
705
|
+
'0,72,0', //99
|
|
706
|
+
'32,72,32', //100
|
|
707
|
+
'0,255,63', //101
|
|
708
|
+
'127,255,159', //102
|
|
709
|
+
'0,200,47', //103
|
|
710
|
+
'95,200,112', //104
|
|
711
|
+
'0,151,32', //105
|
|
712
|
+
'64,151,95', //106
|
|
713
|
+
'0,120,31', //107
|
|
714
|
+
'63,127,79', //108
|
|
715
|
+
'0,72,15', //109
|
|
716
|
+
'32,72,47', //110
|
|
717
|
+
'0,255,127', //111
|
|
718
|
+
'127,255,191', //112
|
|
719
|
+
'0,200,96', //113
|
|
720
|
+
'95,200,144', //114
|
|
721
|
+
'0,151,64', //115
|
|
722
|
+
'79,151,111', //116
|
|
723
|
+
'0,127,63', //117
|
|
724
|
+
'63,127,95', //118
|
|
725
|
+
'0,72,32', //119
|
|
726
|
+
'31,72,48', //120
|
|
727
|
+
'0,255,191', //121
|
|
728
|
+
'127,255,223', //122
|
|
729
|
+
'0,200,144', //123
|
|
730
|
+
'95,200,175', //124
|
|
731
|
+
'0,151,111', //125
|
|
732
|
+
'79,151,128', //126
|
|
733
|
+
'0,120,95', //127
|
|
734
|
+
'63,127,111', //128
|
|
735
|
+
'0,72,48', //129
|
|
736
|
+
'32,72,63', //130
|
|
737
|
+
'0,255,255', //131
|
|
738
|
+
'127,255,255', //132
|
|
739
|
+
'0,200,207', //133
|
|
740
|
+
'96,200,207', //134
|
|
741
|
+
'0,151,144', //135
|
|
742
|
+
'64,151,144', //136
|
|
743
|
+
'0,127,127', //137
|
|
744
|
+
'63,127,127', //138
|
|
745
|
+
'0,72,79', //139
|
|
746
|
+
'32,72,79', //140
|
|
747
|
+
'0,191,255', //141
|
|
748
|
+
'127,223,255', //142
|
|
749
|
+
'0,152,207', //143
|
|
750
|
+
'96,176,207', //144
|
|
751
|
+
'0,111,144', //145
|
|
752
|
+
'64,128,144', //146
|
|
753
|
+
'0,95,127', //147
|
|
754
|
+
'63,111,127', //148
|
|
755
|
+
'0,55,64', //149
|
|
756
|
+
'31,63,64', //150
|
|
757
|
+
'0,127,255', //151
|
|
758
|
+
'112,184,255', //152
|
|
759
|
+
'0,96,192', //153
|
|
760
|
+
'96,151,207', //154
|
|
761
|
+
'0,72,159', //155
|
|
762
|
+
'79,112,144', //156
|
|
763
|
+
'0,63,127', //157
|
|
764
|
+
'63,95,127', //158
|
|
765
|
+
'0,39,79', //159
|
|
766
|
+
'32,56,79', //160
|
|
767
|
+
'0,63,255', //161
|
|
768
|
+
'127,159,255', //162
|
|
769
|
+
'0,48,207', //163
|
|
770
|
+
'96,127,207', //164
|
|
771
|
+
'0,39,159', //165
|
|
772
|
+
'64,95,144', //166
|
|
773
|
+
'0,24,127', //167
|
|
774
|
+
'63,79,127', //168
|
|
775
|
+
'0,15,64', //169
|
|
776
|
+
'32,47,79', //170
|
|
777
|
+
'0,0,255', //171
|
|
778
|
+
'127,127,255', //172
|
|
779
|
+
'0,0,207', //173
|
|
780
|
+
'95,96,192', //174
|
|
781
|
+
'0,0,144', //175
|
|
782
|
+
'79,72,159', //176
|
|
783
|
+
'0,0,127', //177
|
|
784
|
+
'63,63,127', //178
|
|
785
|
+
'0,0,64', //179
|
|
786
|
+
'32,39,79', //180
|
|
787
|
+
'63,0,255', //181
|
|
788
|
+
'159,127,255', //182
|
|
789
|
+
'47,0,192', //183
|
|
790
|
+
'127,103,207', //184
|
|
791
|
+
'32,0,144', //185
|
|
792
|
+
'80,72,144', //186
|
|
793
|
+
'31,0,127', //187
|
|
794
|
+
'79,63,127', //188
|
|
795
|
+
'15,0,79', //189
|
|
796
|
+
'47,39,79', //190
|
|
797
|
+
'127,0,255', //191
|
|
798
|
+
'191,127,255', //192
|
|
799
|
+
'96,0,207', //193
|
|
800
|
+
'144,103,207', //194
|
|
801
|
+
'79,0,144', //195
|
|
802
|
+
'111,72,144', //196
|
|
803
|
+
'63,0,127', //197
|
|
804
|
+
'95,63,127', //198
|
|
805
|
+
'31,0,64', //199
|
|
806
|
+
'48,39,79', //200
|
|
807
|
+
'191,0,255', //201
|
|
808
|
+
'223,127,255', //202
|
|
809
|
+
'144,0,207', //203
|
|
810
|
+
'175,96,192', //204
|
|
811
|
+
'111,0,144', //205
|
|
812
|
+
'128,72,159', //206
|
|
813
|
+
'95,0,127', //207
|
|
814
|
+
'96,56,112', //208
|
|
815
|
+
'48,0,64', //209
|
|
816
|
+
'64,39,79', //210
|
|
817
|
+
'255,0,255', //211
|
|
818
|
+
'255,127,255', //212
|
|
819
|
+
'192,0,192', //213
|
|
820
|
+
'192,96,192', //214
|
|
821
|
+
'144,0,144', //215
|
|
822
|
+
'144,72,144', //216
|
|
823
|
+
'127,0,127', //217
|
|
824
|
+
'127,63,127', //218
|
|
825
|
+
'79,0,79', //219
|
|
826
|
+
'64,32,64', //220
|
|
827
|
+
'255,0,191', //221
|
|
828
|
+
'255,127,223', //222
|
|
829
|
+
'192,0,144', //223
|
|
830
|
+
'192,96,175', //224
|
|
831
|
+
'144,0,111', //225
|
|
832
|
+
'144,72,128', //226
|
|
833
|
+
'127,0,95', //227
|
|
834
|
+
'127,56,111', //228
|
|
835
|
+
'64,0,48', //229
|
|
836
|
+
'79,39,63', //230
|
|
837
|
+
'255,0,127', //231
|
|
838
|
+
'255,127,191', //232
|
|
839
|
+
'192,0,95', //233
|
|
840
|
+
'192,96,144', //234
|
|
841
|
+
'159,0,79', //235
|
|
842
|
+
'144,72,111', //236
|
|
843
|
+
'127,0,63', //237
|
|
844
|
+
'127,63,95', //238
|
|
845
|
+
'64,0,31', //239
|
|
846
|
+
'64,32,48', //240
|
|
847
|
+
'255,0,63', //241
|
|
848
|
+
'255,127,159', //242
|
|
849
|
+
'207,0,48', //243
|
|
850
|
+
'207,103,127', //244
|
|
851
|
+
'144,0,32', //245
|
|
852
|
+
'144,72,95', //246
|
|
853
|
+
'127,0,31', //247
|
|
854
|
+
'127,63,79', //248
|
|
855
|
+
'79,0,15', //249
|
|
856
|
+
'64,32,47', //250
|
|
857
|
+
'47,47,47', //251
|
|
858
|
+
'80,88,80', //252
|
|
859
|
+
'128,128,128', //253
|
|
860
|
+
'175,175,175', //254
|
|
861
|
+
'208,215,208', //255
|
|
862
|
+
'255,255,255', //256
|
|
902
863
|
];
|