Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: bbox bug #6133
    jgnedy
    Member

    Thanks Ronald. I found your second method to work the best for me. I wrote a helper function in a separate module, then used the with block in my function that returns a cell. In this way, the expensive hull calculation is contained.

    @contextmanager
    def temp_attributes(obj, **kwargs):
        prev_vals = {k: getattr(obj, k) for k in kwargs}
        for k, v in kwargs.items():
            setattr(obj, k, v)
        try:
            yield
        finally:
            for k, v in prev_vals.items():
                setattr(obj, k, v)
        ---
    
    with temp_attributes(nd.cfg, use_hull=True, hull_based_bbox=True):
        with Cell('main') as main:
            ...
    in reply to: bbox bug #6130
    jgnedy
    Member

    I understand a little better.  I was hoping to use the bbox (or hull) to extract tight bounding box dimensions of a cell containing many elements, ignoring such rotated bounding boxes of child cells. As you say, the hull of basic elements intentionally matches its bounding box, leading to a similar issue in this case. I thought to try something like “instantiate=False” in the child cell, and/or “hull=True, hull_based_bbox=True”, but no luck. Do you see a way to do this?

    Thanks,

    Joe

    in reply to: trace for Euler bend #6126
    jgnedy
    Member

    Thanks Ronald, good to know. I’ll look into using pathfinder if/when it is ready. I do see one forum post regarding it.

    -Joe

    in reply to: temporary cells and flattened cells #5855
    jgnedy
    Member

    Thanks! I was confused as to the purpose of the instantiate argument. I am now using both instantiate and nd.cfg.cellnames.

Viewing 4 posts - 1 through 4 (of 4 total)