mxcad 1.0.343 → 1.0.344

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/README.md CHANGED
@@ -1,12 +1,8 @@
1
1
 
2
2
  # Preface
3
3
 
4
- The development of mxcad requires dependency on mxdraw, and the two need to work together. Therefore, if you are unfamiliar with the mxdraw library, please refer to:<https://github.com/mxcad/mxdraw/>
5
-
6
4
  If you have any questions during the use of mxcad, feel free to contact us. Contact: 710714273@qq.com
7
5
 
8
- ![](https://www.webcadsdk.com/img/WX-Two-dimensional-code.png);
9
-
10
6
  Official mxcad website: <https://www.webcadsdk.com/>
11
7
 
12
8
  # Quick Start with mxcad
@@ -15,6 +11,8 @@ mxcad supports online rendering of `.mxweb` format files (this file format is ou
15
11
 
16
12
  For specific steps on converting CAD drawing files to `.mxweb` format, please refer to the [drawing conversion steps](#drawing-conversion-steps) below.
17
13
 
14
+ The development of mxcad requires dependency on mxdraw, and the two need to work together. Therefore, if you are unfamiliar with the mxdraw library, please refer to:<https://github.com/mxcad/mxdraw/>
15
+
18
16
  ## Using mxcad with Vite
19
17
 
20
18
  In this section, we will introduce how to create a simple mxcad project locally. The created project will use a build setup based on Vite.
@@ -28,12 +26,11 @@ npm init -y
28
26
  npm install vite -D
29
27
  npm install mxcad
30
28
  ```
31
- :::tip tip Note
32
- If using `pnpm` for installation, you also need to manually install mxdraw
33
- ```sh
34
- `pnpm install mxdraw`
35
- ```
36
- :::
29
+ * If using `pnpm` for installation, you also need to manually install mxdraw
30
+
31
+ ```sh
32
+ pnpm install mxdraw
33
+ ```
37
34
 
38
35
  2. Create a new index.html file in the project root directory and draw a canvas.
39
36
 
@@ -155,7 +152,7 @@ Example of the global build version:
155
152
  </html>
156
153
  ```
157
154
 
158
- 参考示例源码:<https://gitee.com/mxcadx/mxcad_docs/tree/master/examples/h5>
155
+ Reference sample source code:<https://gitee.com/mxcadx/mxcad_docs/tree/master/examples/h5>
159
156
 
160
157
  ### Build the version using the ES module
161
158
 
@@ -292,14 +289,12 @@ Reference sample source code:
292
289
  1. canvas:canvas id of the canvas instance
293
290
 
294
291
  2. locateFile:The core of mxcad relies on the wasm file in the corresponding category (` 2d `|` 2d-st `) under the directory `/mxcad/dist/wasm` in mxcad library (the file is compiled and generated by c++), wherein the 2d directory is multi-threaded programs, and the 2D-ST directory is single-threaded programs. This parameter specifies the network path of the wasm program.
295
-
292
+
296
293
  3. fontspath:Specifies the font file load path in a cad drawing. The default path is `dist/fonts`, where you can add all the font files you need to open your drawings.
297
294
 
298
295
  4. fileUrl:Specifies the network path to open the mxweb drawing.
296
+ * The parameters fontspath, fileUrl and locateFile in the `create()` function that creates mxcad objects in mxcad are network paths.
299
297
 
300
- :::tip Tips
301
- The parameters fontspath, fileUrl and locateFile in the `create()` function that creates mxcad objects in mxcad are network paths.
302
- :::
303
298
  5. onOpenFileComplete: Listen for the callback event when opening a file is successful. Operations to be performed after the drawing is opened can be executed within this method.
304
299
 
305
300
  6. viewBackgroundColor: Set the background color of the view area, with the value in RGB format.
@@ -344,14 +339,14 @@ mxobj.create({
344
339
  },
345
340
  })
346
341
  ```
347
- :::tip Tips
348
- To use SharedArrayBuffer permissions, Google's browser requires access using HTTPS or the local path (http://localhost).
349
- :::
342
+ * To use SharedArrayBuffer permissions, Google's browser requires access using HTTPS or the local path (http://localhost).
350
343
 
351
344
  # Drawing Conversion Steps
352
345
 
353
346
  Due to the large size, multiple versions, and complex format of AutoCAD files (DWG, DXF), directly loading them into web pages is inefficient, occupies large memory space, and is prone to loading failures. Therefore, we have designed and provided a unique web CAD file format: `.mxweb`, which effectively solves the aforementioned numerous issues. mxweb files and CAD drawing files can be converted back and forth using the CloudDraw development package we provide.
354
347
 
348
+ For more detailed conversion steps, please refer to [Drawing conversion](https://mxcad.github.io/mxcad/en/guide/convert.html)
349
+
355
350
  ## Download the CloudDraw Development Package
356
351
 
357
352
  We need to download the [MxDraw CloudDraw development package](https://www.webcadsdk.com/)
@@ -403,9 +398,7 @@ We can also use this program to convert `.mxweb` format files back to `.dwg` for
403
398
  ```bash
404
399
  mxcadassembly.exe {"srcpath":"D:\test.mxweb","outpath":"D:\","outname":"test.dwg"}
405
400
  ```
406
- :::tip Note
407
- The parameter outname must include the suffix of the CAD drawing, generally .dwg
408
- :::
401
+ * The parameter outname must include the suffix of the CAD drawing, generally .dwg.
409
402
 
410
403
  ## Linux Version
411
404
 
package/dist/mxcad.d.ts CHANGED
@@ -6419,6 +6419,14 @@ export declare class McDbPolyline extends McDbCurve {
6419
6419
  * ```
6420
6420
  */
6421
6421
  setType(type: McDb.PolylineType): boolean;
6422
+ /**
6423
+ * 多线段坐标点反向
6424
+ * @param type 多线段类型
6425
+ * @example
6426
+ * ```ts
6427
+ * ```
6428
+ */
6429
+ reverse(): boolean;
6422
6430
  }
6423
6431
  /**
6424
6432
  * 表示一个 CAD 图块引用实体,一个块参考用于放置、缩放和显示它参考的McDbBlockTableRecord中的一个实体集合的实例
@@ -12468,7 +12476,7 @@ export declare class McObject {
12468
12476
  });
12469
12477
  * ```
12470
12478
  */
12471
- loadImage(imageUrl: string, call: (image: any) => void, imageFileName?: string): void;
12479
+ loadImage(imageUrl: string, call: (image: any) => void, imageFileName?: string, fileType?: string): void;
12472
12480
  /**
12473
12481
  * 绘制一个图片
12474
12482
  * @param dPosX 图片 X 坐标
@@ -13714,6 +13722,7 @@ export declare class MxCompare {
13714
13722
  do(base_database: McDbDatabase): boolean;
13715
13723
  /**
13716
13724
  * 得到图纸比较结果
13725
+ * 返回结果[{"id":被修改对象的id,"id_current":当前图纸该对象id,"id_base":原始图纸,该对象id,"pos":修改位置,"type":修改方式,"str":修改说明},...]
13717
13726
  */
13718
13727
  getResult(): any[];
13719
13728
  /**
@@ -14666,12 +14675,17 @@ export interface ICellStyle {
14666
14675
  borderLineType?: string;
14667
14676
  }
14668
14677
  export declare class McDbXlsxTable extends McDbCustomEntity {
14678
+ matrix: McGeMatrix3d;
14669
14679
  private _rowHeight;
14670
14680
  /**
14671
14681
  * 表格整体行高
14672
14682
  * */
14673
14683
  get rowHeight(): number;
14674
14684
  set rowHeight(val: number);
14685
+ /** 表格行数*/
14686
+ get rowCount(): number;
14687
+ /** 表格列数*/
14688
+ get colCount(): number;
14675
14689
  private _colWidth;
14676
14690
  /**
14677
14691
  * 表格整体列宽
@@ -14695,7 +14709,6 @@ export declare class McDbXlsxTable extends McDbCustomEntity {
14695
14709
  private _selectedCells;
14696
14710
  private _cellTextDimensions;
14697
14711
  private _cellStyles;
14698
- private _mat;
14699
14712
  constructor(imp?: any);
14700
14713
  create(imp: any): McDbXlsxTable;
14701
14714
  getTypeName(): string;
@@ -14703,6 +14716,11 @@ export declare class McDbXlsxTable extends McDbCustomEntity {
14703
14716
  getCellStyles(): CellStyleInfo;
14704
14717
  private getTableData;
14705
14718
  private getDefaultStyle;
14719
+ getBoundingBox(): {
14720
+ minPt: McGePoint3d;
14721
+ maxPt: McGePoint3d;
14722
+ ret: boolean;
14723
+ };
14706
14724
  /**
14707
14725
  * 处理合并单元格数据,填充空值
14708
14726
  * 根据合并单元格信息,将合并区域内的空单元格填充为合并区域左上角的值
@@ -14852,6 +14870,13 @@ export declare class McDbXlsxTable extends McDbCustomEntity {
14852
14870
  * @returns 单元格的纯文本值
14853
14871
  */
14854
14872
  getCellTextValue(row: number, col: number): string;
14873
+ /**
14874
+ * 获取指定单元格(考虑合并)在世界坐标系下的四个角点
14875
+ * @param row 行索引 (0-based)
14876
+ * @param col 列索引 (0-based)
14877
+ * @returns McGePoint3d[] 顺序: [左上, 右上, 右下, 左下]
14878
+ */
14879
+ getCellWorldCorners(row: number, col: number): McGePoint3d[] | null;
14855
14880
  /**
14856
14881
  * 获取指定单元格的几何范围
14857
14882
  * @param row 行索引 (0-based)
@@ -14863,6 +14888,15 @@ export declare class McDbXlsxTable extends McDbCustomEntity {
14863
14888
  max: McGePoint3d;
14864
14889
  } | null;
14865
14890
  /**
14891
+ * 将CAD坐标点转换为表格中的单元格位置
14892
+ * @param point CAD空间中的三维点
14893
+ * @returns 单元格位置 {row, col} 或 null (当点不在表格内时)
14894
+ */
14895
+ getCellAtPoint(point: McGePoint3d): {
14896
+ row: number;
14897
+ col: number;
14898
+ } | null;
14899
+ /**
14866
14900
  * 获取指定单元格的A1格式引用
14867
14901
  * @param row 行索引 (0-based)
14868
14902
  * @param col 列索引 (0-based)
@@ -15008,15 +15042,6 @@ export declare class McDbXlsxTable extends McDbCustomEntity {
15008
15042
  row: number;
15009
15043
  col: number;
15010
15044
  })[], verticalAlignment: "top" | "middle" | "bottom"): void;
15011
- /**
15012
- * 将CAD坐标点转换为表格中的单元格位置
15013
- * @param point CAD空间中的三维点
15014
- * @returns 单元格位置 {row, col} 或 null (当点不在表格内时)
15015
- */
15016
- getCellAtPoint(point: McGePoint3d): {
15017
- row: number;
15018
- col: number;
15019
- } | null;
15020
15045
  getGripPoints(): McGePoint3dArray;
15021
15046
  moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number): void;
15022
15047
  transformBy(_mat: McGeMatrix3d): boolean;
@@ -15900,6 +15925,7 @@ export declare function mx_gcj02_To_gps84(lng: any, lat: any): {
15900
15925
  export declare class MxTIFFLoader {
15901
15926
  private imp;
15902
15927
  load(url: string, onLoad?: (texture: any) => void, onError?: (event: any) => void): void;
15928
+ setInverse(val: boolean): void;
15903
15929
  }
15904
15930
 
15905
15931
  export {};