0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

manimの作法 その2

Last updated at Posted at 2021-01-02

概要

manimの作法、調べてみた。
SVGMobject、使ってみた。

9vaeでsvg書いた。

image.png

できたsvg

pathのd属性しか使っていない。

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator:9va-0.7.7 (9va-win) http://9vae.blogspot.jp/ -->
<svg xmlns:xlink="http://www.w3.org/1999/xlink" image-rendering="optimizeSpeed" baseProfile="basic" version="1.1"  xmlns="http://www.w3.org/2000/svg"
  id="03.svg" viewBox="0 0 512 288" >
  <defs>
  <mask id="SVG_Canvas"><rect fill="#FFFFFF" x="0" y="0" width="512" height="288"></rect></mask>
  </defs>
  <g id="SVG_Still" mask="url(#SVG_Canvas)">
    <path fill="#80ffff" stroke="#000000" stroke-width="1.00" d="M55.00,46.00C62.13,46.00 74.13,46.00 88.50,46.00 C102.81,46.00 114.81,46.00 122.00,46.00C122.00,51.63 122.00,61.13 122.00,72.50 C122.00,83.81 122.00,93.31 122.00,99.00C114.81,99.00 102.81,99.00 88.50,99.00 C74.13,99.00 62.13,99.00 55.00,99.00C55.00,93.31 55.00,83.81 55.00,72.50 C55.00,61.13 55.00,51.63 55.00,46.00Z"></path>
    <path fill="none" stroke="#000000" stroke-width="1.00" d="M169.00,36.00C175.81,36.00 187.25,36.00 201.00,36.00 C214.69,36.00 226.13,36.00 233.00,36.00C233.00,44.13 233.00,57.69 233.00,74.00 C233.00,90.25 233.00,103.81 233.00,112.00C226.13,112.00 214.69,112.00 201.00,112.00 C187.25,112.00 175.81,112.00 169.00,112.00C169.00,103.81 169.00,90.25 169.00,74.00 C169.00,57.69 169.00,44.13 169.00,36.00Z"></path>
    <path fill="#80ffff" stroke="#000000" stroke-width="1.00" d="M59.00,126.00 C66.00,125.75 71.75,128.19 76.63,133.38 C81.75,138.19 84.19,143.94 84.00,151.00 C84.19,158.00 81.75,163.75 76.63,168.63 C71.75,173.75 66.00,176.19 59.00,176.00 C51.94,176.19 46.19,173.75 41.38,168.63 C36.19,163.75 33.75,158.00 34.00,151.00 C33.75,143.94 36.19,138.19 41.38,133.38 C46.19,128.19 51.94,125.75 59.00,126.00 Z"></path>
    <path fill="none" stroke="#000000" stroke-width="1.00" d="M134.00,100.00 C140.13,99.69 145.25,103.06 149.50,110.31 C154.00,117.06 156.13,125.13 156.00,135.00 C156.13,144.81 154.00,152.88 149.50,159.69 C145.25,166.88 140.13,170.25 134.00,170.00 C127.81,170.25 122.75,166.88 118.50,159.69 C113.94,152.88 111.81,144.81 112.00,135.00 C111.81,125.13 113.94,117.06 118.50,110.31 C122.75,103.06 127.81,99.69 134.00,100.00 Z"></path>
    <path fill="#80ffff" stroke="#000000" stroke-width="1.00" d="M318.00,71.00C316.38,66.13 313.69,58.81 310.00,54.00 C306.19,50.63 302.69,50.88 300.00,54.00 C297.56,55.81 296.81,59.56 297.00,67.00 C295.88,74.88 295.75,83.75 299.00,93.00 C302.19,102.00 307.38,108.13 316.00,112.00 C325.13,116.19 334.50,116.63 343.00,114.00 C350.56,113.88 354.31,111.56 357.00,101.00 C361.75,86.06 364.13,67.19 361.00,54.00 C356.38,44.25 347.69,43.88 338.00,49.00 C329.00,54.56 322.06,64.31 318.00,71.00Z"></path>
    <path fill="none" stroke="#000000" stroke-width="1.00" d="M429.00,76.00 C416.69,74.13 406.81,64.19 401.00,57.00C398.50,64.56 396.25,77.00 403.00,91.00 C415.56,104.38 433.81,114.81 446.00,121.00L465.00,57.00 L459.00,51.00 C452.38,59.50 441.56,71.56 429.00,76.00 Z"></path>
    <path fill="#80ffff" stroke="#000000" stroke-width="1.00" d="M48.00,196.00L48.00,249.00 100.00,242.00 48.00,196.00 Z"></path>
    <path fill="none" stroke="#000000" stroke-width="1.00" d="M158.00,193.00L155.00,249.00 208.00,248.00 158.00,193.00 Z"></path>
  <text fill="#000000" text-anchor="middle" font-family="sans-serif" x="304.0000" y="179.4000" font-size="21">
A</text>
  </g>
<!-- SourceCode:9va-0.7.7 (9va-win) --><!--
IwZFVkEtUyBWAgEAagFJBAIAASBCBAABAQBaBAH///9PIQRDOlxVc2Vyc1x6ZW9uXERvY3VtZW50c1wwMy5zdmcjAE8AUABkTAgAAANwAuAFiALgB6AC4AegBIgHoAYwBYgGMANwBjADcASIdxB04mQAWID//wD//wAAAAAAACQDCAAAJAUGAAAAAEMBVUUATAgAAAqQAkAMkAJADpACQA6QBKAOkAcADJAHAAqQBwAKkASgdAJYgP//////AP8AAAAATAgAAAOwB+AEyghWBUAJcATKCooDsAsAApYKigIgCXAClghWdOJYgP//AP//AAAAAAAAQwH/TAgAAAhgBkAJWAblCcAIcAlYCfsIYAqgB2gJ+wcACHAHaAbldAJYgP//////AP8AAAAATAoAABPgBHATYANgEsADYBKQBDASsAXQE8AHABVwByAWUAZQFpADYBUgAxB04liA//8A//8AAAAAAABDAn/ARQBMBgAAGtAEwBkQA5AZMAWwG+AHkB0QA5AcsAMwdAJYgP//////AP8AAAAAQwGgRQBMAwAAAwAMQAMAD5AGQA8gdOJYgP//AP//AAAAAAAAQwBFAEwDAAAJ4AwQCbAPkA0AD4B0AliA//////8A/wAAAABUCwAAEpgKCBNoC1hBYQBmAG8AZABYgP//AP//AAAAAAAASA0AAAAVAA0AAAAAEAAAZQBKAYAkBQCAgIAAJAUBAAAAAP//
-->
</svg>

サンプルコード

from manimlib.imports import *

class test(Scene):
	def construct(self):
		c = SVGMobject(file_name="03.svg")
		self.add(c)
		self.wait()

結果

image.png

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?