[..] La conception [swl] meuble_moucheture_d_herminescl

Code
int meuble_moucheture_d_hermine_swl(){ scltracefa(§, ƒ, ); scltracefc("scl-%s (%s) : %s\n\n", sclver(), sclsec(), temps_char(0)); int dimn=4, crdj[4]={1, 2, 1, 1}; int cn1, cn2, cn3, cn4; int ci, pi, pa, pe; char svgpath[]="../../../php/wks-eclipse/emosign/prd/hr/20110831032136!Meuble_Moucheture_d_hermine.svg"; void **pth1=svg_path_xpl(svgpath, dimn, &crdj[0], 0, &cn1); /*int *pn1=(int*)pth1[0];*/ double **px1=(double**)pth1[1], **py1=(double**)pth1[2]; crdj[0]=1; crdj[1]=2; crdj[2]=1; crdj[3]=3; void **pth3=svg_path_xpl(svgpath, dimn, &crdj[0], 0, &cn3); int *pn3=(int*)pth3[0]; double **px3=(double**)pth3[1], **py3=(double**)pth3[2]; double xa3= rd, xe3=-rd; for(ci=0;ci<cn3;ci++){ for(pi=0;pi<pn3[ci];pi++){ if(xa3>px3[ci][pi]){ xa3=px3[ci][pi]; pa=pi; } if(xe3<px3[ci][pi]){ xe3=px3[ci][pi]; pe=pi; } } } double x3_a=px3[0][pa], y3_a=py3[0][pa]; double x3_e=px3[0][pe], y3_e=py3[0][pe]; crdj[0]=1; crdj[1]=2; crdj[2]=1; crdj[3]=2; void **pth2=svg_path_xpl(svgpath, dimn, &crdj[0], 0, &cn2); int *pn2=(int*)pth2[0]; double **px2=(double**)pth2[1]/*, **py2=(double**)pth2[2]*/; double xa2= rd, xe2=-rd; for(ci=0;ci<cn2;ci++){ for(pi=0;pi<pn2[ci];pi++){ if(xa2>px2[ci][pi]){ xa2=px2[ci][pi]; } if(xe2<px2[ci][pi]){ xe2=px2[ci][pi]; } } } scltracefc("Translation : %lf, %lf\n", xa2-(-xe3), xe2-(-xa3)); crdj[0]=1; crdj[1]=2; crdj[2]=1; crdj[3]=4; void **pth4=svg_path_xpl(svgpath, dimn, &crdj[0], 0, &cn4); int *pn4=(int*)pth4[0]; double **px4=(double**)pth4[1], **py4=(double**)pth4[2]; double x4_a=px4[0][pa], y4_a=py4[0][pa]; double x4_e=px4[0][pe], y4_e=py4[0][pe]; double xv1=x3_e-x3_a, yv1=y3_e-y3_a, xv2=x4_e-x4_a, yv2=y4_e-y4_a, thetarad; angle(xv1, yv1, 1, &xv2, &yv2, &thetarad); std::string imgname=std::string(ƒ)+".svg", imgpath="./srt/"+imgname; double xs1[2]={x3_a, x3_e}, ys1[2]={y3_a, y3_e}; double xs2[2]={x4_a, x4_e}, ys2[2]={y4_a, y4_e}; double xx, yx; intersegment(x3_a, y3_a, x3_e, y3_e, x4_a, y4_a, x4_e, y4_e, &xx, &yx); scltracefc("Rotation : %lf, %lf, %lf\n", thetarad/π*180, xx, yx); double *rx=new double[pn3[0]], *ry=new double[pn3[0]]; tournepolygone(pn3[0], px3[0], py3[0], xx, yx, -thetarad, rx, ry); graf_dis(imgpath.c_str(), 2, &xs1[0], &ys1[0], "curve", 2, &xs2[0], &ys2[0], "curve", 1, &xx, &yx, "curve", pn3[0], rx, ry, "linespec", "--h;--h;h*;--h", "axis", "equal", "subtitlex", imgname.c_str(), "snake", pn3[0], px3[0], py3[0], , "snake", pn4[0], px4[0], py4[0], , "colorline", "qhult;qhult", "linespeca", "-a", ); double tx=-px1[0][0], ty=-py1[0][0]; double dr=0.1; int ndigit = (int)ceil(-log10(dr-floor(dr))); crdj[0]=1; crdj[1]=2; crdj[2]=1; crdj[3]=1; char *path1883=translatepath_svg_xpl(svgpath, dimn, &crdj[0], tx, ty, dr, &cn1); crdj[0]=1; crdj[1]=2; crdj[2]=1; crdj[3]=3; char *path1893=translatepath_svg_xpl(svgpath, dimn, &crdj[0], tx, ty, dr, &cn3); char svgpath_s[]="./srt/Meuble_Moucheture_d_hermine-rev-02.02.svg"; scltracefc("SVG file generation: %s\n", svgpath_s); FILE *svg=fopen(svgpath_s, "w+"); fprintf(svg, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"); fprintf(svg, "<!-- Created with Inkscape (http://www.inkscape.org/) -->\n"); fprintf(svg, "<!-- Modified by scientil-%s %s -->\n", sclver(), temps_char(0)); fprintf(svg, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"%s\" height=\"%s\">\n", dbl_str(174.18246, ndigit), dbl_str(326.1676, ndigit)); fprintf(svg, " <g transform=\"translate(%s,%s)\" style=\"stroke:#000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round\">\n", dbl_str(-288.6282+px1[0][0], ndigit), dbl_str(-44.98148+py1[0][0], ndigit)); fprintf(svg, " <path d=\"%s\"/>\n", path1883); fprintf(svg, " <path d=\"%s\" id=\"h\"/>\n", path1893); fprintf(svg, " <use xlink:href=\"#h\" transform=\"rotate(%s %s %s)\"/>\n", dbl_str(-thetarad/π*180, ndigit), dbl_str(xx-px1[0][0], 1), dbl_str(yx-py1[0][0], ndigit)); fprintf(svg, " <use xlink:href=\"#h\" transform=\"scale(-1,1) translate(%s 0)\"/>\n", dbl_str(-(xa2-px1[0][0]-(-(xe3-px1[0][0]))), ndigit)); fprintf(svg, " </g>\n"); fprintf(svg, "</svg>"); fclose(svg); scltracefe(§, ƒ, ); return 0; } /* ƒ décorée par 🔬 le 27-09-2025 13:20:35 */
Sortie
[>..\xpl\src\scl.swl.cpp.meuble_moucheture_d_hermine_swl] scl-25.09 (gwin64) : 27-09-2025 13:20:35 [>..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] cn=1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 27.09.2025 Time : 13:20:35 Pageformat: DA4L << << Vectors : 424 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/20110831032136!Meuble_Moucheture_d_hermine << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] [>..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] cn=1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 27.09.2025 Time : 13:20:35 Pageformat: DA4L << << Vectors : 186 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/20110831032136!Meuble_Moucheture_d_hermine << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] [>..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] cn=1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 27.09.2025 Time : 13:20:35 Pageformat: DA4L << << Vectors : 184 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/20110831032136!Meuble_Moucheture_d_hermine << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] Translation : 751.438810, 751.438810 [>..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] cn=1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 27.09.2025 Time : 13:20:35 Pageformat: DA4L << << Vectors : 186 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/20110831032136!Meuble_Moucheture_d_hermine << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [<..\xpl\src\sclsvg.xpl.cpp.svg_path_xpl] Rotation : 77.399991, 369.765347, 139.228988 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << END OF DISLIN / VERSION 11.3.2 << << Date : 27.09.2025 Time : 13:20:35 Pageformat: DA4L << << Vectors : 553 Warnings: 0 Fileformat: SVG << << Metafile: ./srt/meuble_moucheture_d_hermine_swl.svg << <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [>..\xpl\src\sclsvg.xpl.cpp.translatepath_svg_xpl] path='M0 0c-14.1 70.1-40.4 119.8-68.9 155.4c11.9-3.6 25.2-13.7 38.1-22.5c-7.9 18.4-15.8 34.4-23.7 50.7c4.7-1.7 19.7-18.1 40-42.1c3.2 33 7.5 70.2 13.9 92.6c5.1-22.4 8.9-59.4 13-93.3c12.2 15.2 24.1 30.6 40.7 43.6L29.8 132c12 8.4 25.3 19.5 38 24.2c-30.2-37.5-55.6-86-67.8-156.2z' [<..\xpl\src\sclsvg.xpl.cpp.translatepath_svg_xpl] [>..\xpl\src\sclsvg.xpl.cpp.translatepath_svg_xpl] path='M54.6 3.7c1.3-4.1 19.5 9 29.6-18.4c-24 27.6-48.8-29-68.8 8.9c-6.2 15.7 20.9 42.9 39.2 9.4z' [<..\xpl\src\sclsvg.xpl.cpp.translatepath_svg_xpl] SVG file generation: ./srt/Meuble_Moucheture_d_hermine-rev-02.02.svg [<..\xpl\src\scl.swl.cpp.meuble_moucheture_d_hermine_swl]