Adding logo

This commit is contained in:
Roger Maitland 2022-08-18 11:11:13 -04:00
parent 3252996a80
commit 22bf857801
5 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,5 @@
<img align="center" src="docs/logo.png">
build123d is an alternate to the [CadQuery](https://cadquery.readthedocs.io/en/latest/index.html) build123d is an alternate to the [CadQuery](https://cadquery.readthedocs.io/en/latest/index.html)
Fluent API. It has several advantages over this API but the largest one is that build123d Fluent API. It has several advantages over this API but the largest one is that build123d
enables the full python toolbox when designing objects - for loops, references to objects, enables the full python toolbox when designing objects - for loops, references to objects,

View file

@ -25,6 +25,8 @@
.. highlight:: python .. highlight:: python
.. image:: logo.png
build123d is an alternate to the `CadQuery <https://cadquery.readthedocs.io/en/latest/index.html>`_ build123d is an alternate to the `CadQuery <https://cadquery.readthedocs.io/en/latest/index.html>`_
Fluent API. It has several advantages over this API but the largest one is that build123d Fluent API. It has several advantages over this API but the largest one is that build123d
enables the full python toolbox when designing objects - for loops, references to objects, enables the full python toolbox when designing objects - for loops, references to objects,

BIN
docs/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View file

@ -89,8 +89,8 @@ class Add(Compound):
] ]
context.locations = [Location(Vector())] context.locations = [Location(Vector())]
context._add_to_context(*new_objects, mode=mode) context._add_to_context(*new_objects, mode=mode)
elif isinstance(context, BuildSketch): elif isinstance(context, (BuildLine, BuildSketch)):
rotation_angle = rotation if isinstance(rotation, float) else 0.0 rotation_angle = rotation if isinstance(rotation, (int, float)) else 0.0
new_objects = [] new_objects = []
for obj in objects: for obj in objects:
new_objects.extend( new_objects.extend(
@ -103,11 +103,11 @@ class Add(Compound):
) )
context._add_to_context(*new_objects, mode=mode) context._add_to_context(*new_objects, mode=mode)
context.locations = [Location(Vector())] context.locations = [Location(Vector())]
elif isinstance(context, BuildLine): # elif isinstance(context, BuildLine):
new_objects = [obj for obj in objects if isinstance(obj, Edge)] # new_objects = [obj for obj in objects if isinstance(obj, Edge)]
for new_wires in filter(lambda o: isinstance(o, Wire), objects): # for new_wires in filter(lambda o: isinstance(o, Wire), objects):
new_objects.extend(new_wires.Edges()) # new_objects.extend(new_wires.Edges())
context._add_to_context(*new_objects, mode=mode) # context._add_to_context(*new_objects, mode=mode)
else: else:
raise RuntimeError( raise RuntimeError(
f"Add does not support builder {context.__class__.__name__}" f"Add does not support builder {context.__class__.__name__}"

View file

@ -71,6 +71,7 @@ class BuildLine(Builder):
def __init__(self, mode: Mode = Mode.ADD): def __init__(self, mode: Mode = Mode.ADD):
self.line = [] self.line = []
self.locations: list[Location] = [Location(Vector())]
super().__init__(mode) super().__init__(mode)
def vertices(self, select: Select = Select.ALL) -> ShapeList[Vertex]: def vertices(self, select: Select = Select.ALL) -> ShapeList[Vertex]: