html - 是否可以使用 svg 制作此图像
问题描述
这是我想要制作的图像。
但这是我的 SVG 代码
<svg class="teeth" id="svg"
width="400px" height="300px" viewBox="0 0 400 300" preserveAspectRatio="xMidYMid meet">
<!-- upper right 8 -->
<g id="molar-group" class="molar">
<rect x="75" y="75" stroke="black" id="disto-occlusal" style="stroke-width: 5px;" width="125" height="150" fill="white"/>
<rect x="200" y="75" stroke="black" id="mesio-occlusal" style="stroke-width: 5px;" width="125" height="150" fill="white"/>
<polygon stroke="black" id="disto-buccal" style="stroke-width: 5px;" points="0 0 200 0 200 75 75 75" fill="white" />
<polygon stroke="black" id="mesio-buccal" style="stroke-width: 5px;" points="200 0 400 0 325 75 200 75" fill="white" />
<polygon stroke="black" id="mesial" style="stroke-width: 5px;" points="400 0 400 300 325 225 325 75" fill="white" />
<polygon stroke="black" id="mesio-palatal" style="stroke-width: 5px;" points="400 300 200 300 200 225 325 225" fill="white" />
<polygon stroke="black" id="disto-palatal" style="stroke-width: 5px;" points="200 300 0 300 75 225 200 225" fill="white" />
<polygon stroke="black" id="distal" style="stroke-width: 5px;" points="0 300 0 0 75 75 75 225" fill="white" />
</g>
</svg>
我的 SVG 代码的输出如下图所示:
任何人都可以帮助我如何根据我的 SVG 代码制作第一张图片吗?第二张图片中唯一缺少的是 X 线,任何人都可以帮助如何在第一张图片中添加 X 线,可以使用 SVG 吗?
解决方案
第二张图片中唯一缺少的是 X 线,任何人都可以帮助如何在第一张图片中添加 X 线,可以使用 SVG 吗?
要添加X
到图像中,只需添加几行<polyline>
<svg class="teeth" id="svg"
width="400px" height="300px" viewBox="0 0 400 300" preserveAspectRatio="xMidYMid meet">
<!-- upper right 8 -->
<g id="molar-group" class="molar">
<rect x="75" y="75" stroke="black" id="disto-occlusal" style="stroke-width: 5px;" width="125" height="150" fill="white"/>
<rect x="200" y="75" stroke="black" id="mesio-occlusal" style="stroke-width: 5px;" width="125" height="150" fill="white"/>
<polygon stroke="black" id="disto-buccal" style="stroke-width: 5px;" points="0 0 200 0 200 75 75 75" fill="white" />
<polygon stroke="black" id="mesio-buccal" style="stroke-width: 5px;" points="200 0 400 0 325 75 200 75" fill="white" />
<polygon stroke="black" id="mesial" style="stroke-width: 5px;" points="400 0 400 300 325 225 325 75" fill="white" />
<polygon stroke="black" id="mesio-palatal" style="stroke-width: 5px;" points="400 300 200 300 200 225 325 225" fill="white" />
<polygon stroke="black" id="disto-palatal" style="stroke-width: 5px;" points="200 300 0 300 75 225 200 225" fill="white" />
<polygon stroke="black" class="distal" style="stroke-width: 5px;" points="0 300 0 0 75 75 75 225" fill="white" />
<!-- Two lines added -->
<polygon stroke="black" class="distal" style="stroke-width: 5px;" points="100 300 300 0" fill="white" />
<polygon stroke="black" class="distal" style="stroke-width: 5px;" points="300 300 100 0" fill="white" />
</g>
</svg>
推荐阅读
- excel - VBA 使用 Like 运算符删除行
- reactjs - 为什么我的 thunk 在这个 fetch 语句中不起作用?
- xaml - 从 Xamarin 表单中的列表中删除项目
- c++ - 有没有办法使用类的私有枚举值作为模板参数?
- c# - 返回奇数 JSON 层次结构的集合导航属性
- amazon-web-services - AWS 弹性 IP 与公共 IP
- database - MongoDB:进行远程访问时“连接尝试失败”
- filechooser - JavaFX 的 FileChooser 中无法显示选定的文件
- ios - webview 上的 datepicker 显示奇怪。在 IphoneX 上
- c++ - C++ 在结构向量中存储回调函数 - 性能、调用选项、释放问题