Overlapping opaque black polygons with white edges #1030
Unanswered
superfede76
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You cannot use ACI as color for that specific use case. ACI stands for AutoCAD Color Index and is simply an index into a vendor specific color table or a color table that you provide as a DWG Trueview Modelspace: DWG Trueview Paperspace: But BricsCAD disagree about these default colors: The better way is to use true color values: import ezdxf
from ezdxf import colors
import random
def create_solid_triangles_inside_square(num_triangles):
doc = ezdxf.new(dxfversion="R2010")
msp = doc.modelspace()
for _ in range(num_triangles):
triangle_vertices = [
(random.uniform(0, 10), random.uniform(0, 10)),
(random.uniform(0, 10), random.uniform(0, 10)),
(random.uniform(0, 10), random.uniform(0, 10)),
]
msp.add_solid(
triangle_vertices, dxfattribs={"true_color": colors.rgb2int((0, 0, 0))}
)
msp.add_lwpolyline(
triangle_vertices,
close=True,
dxfattribs={"true_color": colors.rgb2int((255, 255, 255))},
)
doc.saveas("marker_rgb.dxf")
if __name__ == "__main__":
num_triangles = 5
create_solid_triangles_inside_square(num_triangles) That guarantees to get the same color in every CAD application (if you ignore color spaces): |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I need to overlap some triangles so that you can only see the white edge, and inside it is black. If I try to fill the interior with another color,fro example blue, it works, but with black it does not.
this is my code working with blu tringles with white boundary
Can anyone help?
Thank you
Edit: I need to overlap some triangles so that you can only see the white edge, and inside it is empty (not black!) like in the below example.
Beta Was this translation helpful? Give feedback.
All reactions