Anchor With_Side
# Minimal complete example: anchor.with_sidepage=canvas(size=(100mm,75mm),background="#ffffff")curve=page.add(path(commands=[move_to(0mm,0mm),cubic_to(0mm,0mm,0mm,35mm,50mm,35mm),cubic_to(65mm,35mm,70mm,0mm,75mm,0mm),line_to(82mm,12mm)],border_color="#0072b2",border_width=0.7mm),offset=(8mm,15mm))route=curve.path.subpaths[0]dot=ellipse(size=(2mm,2mm),fill="#e36b70")corner=route.corners()[0].with_side(incoming)page.add(line(length=8mm,line_color="#e36b70"),anchor=self.path.start,target=corner,rotation=corner.tangent_angle)# Minimal complete example: anchor.with_sidepage=canvas(size=(100mm,75mm),background="#ffffff")curve=page.add(path(commands=[move_to(0mm,0mm),cubic_to(0mm,0mm,0mm,35mm,50mm,35mm),cubic_to(65mm,35mm,70mm,0mm,75mm,0mm),line_to(82mm,12mm)],border_color="#0072b2",border_width=0.7mm),offset=(8mm,15mm))route=curve.path.subpaths[0]dot=ellipse(size=(2mm,2mm),fill="#e36b70")corner=route.corners()[0].with_side(incoming)page.add(line(length=8mm,line_color="#e36b70"),anchor=self.path.start,target=corner,rotation=corner.tangent_angle)预览
背景
依赖文件
examples/manual/anchor-with_side.lay
复现
laymesh validate examples/manual/anchor-with_side.laylaymesh render examples/manual/anchor-with_side.lay -o figure.svglaymesh render examples/manual/anchor-with_side.lay -o figure.pdflaymesh render examples/manual/anchor-with_side.lay -o figure.png --dpi 300