Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hatched bonds #6

Open
Luis-Henrique655 opened this issue Jun 18, 2020 · 1 comment
Open

Hatched bonds #6

Luis-Henrique655 opened this issue Jun 18, 2020 · 1 comment

Comments

@Luis-Henrique655
Copy link

I was trying to make some molecules and I noticed that hatched bonds show up as normal bonds

class Methane(Scene):
def construct(self):
f1 = ChemObject("C(-[5]H)(-[2]H)(<[:-70]H)(<:[:-20]H)")
self.play(Write(f1))
self.wait()

Methane (1)

also I'm having some trouble trying to change the color of bonds and atoms

class Chem2(Scene):
def construct(self):
f1 = ChemObject("-[:30]=[:-30,,,,red]-[:30]")
self.play(Write(f1))
self.wait()

Chem2

Does anyone know what am I doing wrong?

@kilacoda
Copy link
Owner

Hi, really sorry for a late response.

I looked into it and can confirm that the hatched bonds do in fact not show up.The SVG produced by TeX looks fine though:
image
I'm assuming this is a problem with Manim's SVG parser which already has quite a few problems. I'm sorry but I don't think there's anything I can do about this at the moment.

Regarding the colors, Manim flushes out all colors except black and white in SVGs. There is a workaround though:

        self.add(f1,get_submobject_index_labels(f1[0])) ## shows the indexes of each part of the molecule.

Result:
image

        ## you can remove the previous line if you want to
        f1[0][1:3].set_color(RED)
        self.add(f1)

Result:
image

Hope this helps. Once again, sorry for a late response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants