When I rotate the gate-not, it doesn't rendered properly #1

Open
opened 2024-10-12 06:38:40 +00:00 by Ajsoabk · 2 comments

As shown in the image below, the NAND gate is not rendered correctly, and at the same time, other components have similar problems, is there any other way to rotate the components correctly?

As shown in the image below, the NAND gate is not rendered correctly, and at the same time, other components have similar problems, is there any other way to rotate the components correctly?
Owner

Unfortunately, there is currently no easy way to rotate components
It is indeed an important missing feature which I'll look into implementing

Unfortunately, there is currently no easy way to rotate components It is indeed an important missing feature which I'll look into implementing
HEL added the
feature request
label 2024-10-12 15:00:05 +00:00
Author

I found the input port of the rotated gate could render properly, so I changed the logic of output port by emulating the logic of input port, as shown below (the blue circles are intersections that I use to anchor the output), it works fine with NOT gate and AND gate
image

But it failed with XOR gate and OR gate, the circle of the inverted output port is inside of those two gates, which is not right. When I dive into the problem, I found a hidden line which is used to locate the "north" and "south" anchors, the hidden line only appears in the draw-shape function of OR and XOR, so it disturbs the size of intersections, as shown below
image

It seems that the logic of "draw" and "determine the anchors" is not well delineated:

  1. The draw_shape function is not only used for "draw", but also used for determine the "north" and "south" anchor, while the gate function is used for determine the "east", "west", "output" and other input anchors
  2. The draw_shape function is specific to each gate, while the gate function is called by every gate

So I recommended to determine the "east", "west" and "output" anchors within the draw_shape function, while leave the implementation of input anchors within the gate function.

I found the input port of the rotated gate could render properly, so I changed the logic of output port by emulating the logic of input port, as shown below (the blue circles are intersections that I use to anchor the output), it works fine with NOT gate and AND gate <img width="1285" alt="image" src="attachments/c2e49ac5-6698-437c-b043-e4fc3136efa1"> But it failed with XOR gate and OR gate, the circle of the inverted output port is inside of those two gates, which is not right. When I dive into the problem, I found a hidden line which is used to locate the "north" and "south" anchors, the hidden line only appears in the `draw-shape` function of OR and XOR, so it disturbs the size of intersections, as shown below <img width="1418" alt="image" src="attachments/707d9a97-15cb-4f34-b5e2-56675bbd7aad"> It seems that the logic of "draw" and "determine the anchors" is not well delineated: 1. The `draw_shape` function is not only used for "draw", but also used for determine the "north" and "south" anchor, while the `gate` function is used for determine the "east", "west", "output" and other input anchors 2. The `draw_shape` function is specific to each gate, while the `gate` function is called by every gate So I recommended to determine the "east", "west" and "output" anchors within the `draw_shape` function, while leave the implementation of input anchors within the `gate` function.
205 KiB
194 KiB
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HEL/circuiteria#1
No description provided.