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?
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
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
It seems that the logic of "draw" and "determine the anchors" is not well delineated:
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
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.
oh yeah it is not good to have draw and rotation mixed but I wouldn't know hot not to mix it with this architecture, I handle rotations here if you are interested
oh yeah it is not good to have draw and rotation mixed but I wouldn't know hot not to mix it with this architecture, I handle rotations here if you are interested
https://typst.app/project/pCiRocNZmVsfnFaeKR9rLn
I think the best way to add rotation is here
https://git.kb28.ch/HEL/circuiteria/src/commit/2bb7e3b5a98577297a53d4aefb8732e3dd761f4a/src/elements/element.typ#L47
Yes, the pipeline here is not ideal, everything is mixed together
I'd like to make it more modular and better use CeTZ' features so that it'd be easier to add new components
Yes, the pipeline here is not ideal, everything is mixed together
I'd like to make it more modular and better use CeTZ' features so that it'd be easier to add new components
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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?
Unfortunately, there is currently no easy way to rotate components
It is indeed an important missing feature which I'll look into implementing
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

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-shapefunction of OR and XOR, so it disturbs the size of intersections, as shown belowIt seems that the logic of "draw" and "determine the anchors" is not well delineated:
draw_shapefunction is not only used for "draw", but also used for determine the "north" and "south" anchor, while thegatefunction is used for determine the "east", "west", "output" and other input anchorsdraw_shapefunction is specific to each gate, while thegatefunction is called by every gateSo I recommended to determine the "east", "west" and "output" anchors within the
draw_shapefunction, while leave the implementation of input anchors within thegatefunction.oh yeah it is not good to have draw and rotation mixed but I wouldn't know hot not to mix it with this architecture, I handle rotations here if you are interested
https://typst.app/project/pCiRocNZmVsfnFaeKR9rLn
I think the best way to add rotation is here
Yes, the pipeline here is not ideal, everything is mixed together
I'd like to make it more modular and better use CeTZ' features so that it'd be easier to add new components