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

Curve segments #5

Open
mkcook opened this issue Nov 5, 2024 · 1 comment
Open

Curve segments #5

mkcook opened this issue Nov 5, 2024 · 1 comment

Comments

@mkcook
Copy link

mkcook commented Nov 5, 2024

I want to adjust the shape of the lines reflecting my reactions. When I use any variation of a setCurveSegment function, it does not change the line that is existing, instead it adds a new line. For example, when I use the code below the original R10 never moves, but I do get a new line that is the shape I want. Am I using the function wrong, or is there another similar function that does what I'm looking for?

M1.setCurveSegmentStartPointX('R10', 2764.0)
M1.setCurveSegmentStartPointY('R10', 943.0)

M1.setCurveSegmentEndPointX('R10', 2399.0)
M1.setCurveSegmentEndPointY('R10', 1220.0)

M1.setCurveSegmentBasePoint1X('R10', 2764.0)
M1.setCurveSegmentBasePoint1Y('R10', 1220.0)

M1.setCurveSegmentBasePoint2X('R10', 2764.0)
M1.setCurveSegmentBasePoint2Y('R10', 1220.0)

M1.draw()

Also, it seems that the text box for species is not centered around it's coordinates, rather one of the corners is located at the coordinates. This means that the coordinates I set for the species don't line up correctly with the coordinates I am setting for the curve segment. Is this intentional? Is there an option to center the text boxes for species on the provided coordinates instead?

@adelhpour
Copy link
Member

My assumption is that your intention is setting the curves connecting species to a reaction centroid node. If that is the case, you need to use functions that has this "setSpeciesReferenceCurveSegment[...]" form. Note that you need to pass the index of the curve to these function as 'species_reference_index' argument. This might be a little bit complicated to use, so fee free to ask me to set up a meeting to go through it.

I'm not entirely sure I fully understand the issue, but it seems like your assumption might be that the 'x' and 'y' values of the bounding box for a species glyph correspond to the center of the box. That's not actually the case and the 'x' and 'y' values correspond to the top-left corner of the bounding box, and not its center. Let me know if knowing that fixes your issue.

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