Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More shape/free func improvements #1692

Merged
merged 62 commits into from
Nov 11, 2024
Merged

More shape/free func improvements #1692

merged 62 commits into from
Nov 11, 2024

Conversation

adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Oct 27, 2024

  • normalAt for surfaces
  • bad fonts workaround (fuse)
  • loft to/from vertex
  • edge/face trim
  • more loft options
    • parametrization
    • continuity
  • shell construction fix
  • aux spine for sweep
  • params for spline
  • cq.vis.show extensions
  • tests

cq.vis.show demo:

show(
   sphere(1),
    circle(1).moved(rx=90).positions(linspace(0,1)),
    circle(1).locations(linspace(0,1)),
    Location(),
    circle(1),
    plane(0.5,0.5),
    scale=0.2,
    alpha=0.5
)

afbeelding

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review November 9, 2024 19:50
@adam-urbanczyk
Copy link
Member Author

A lot of small, mostly advanced, but very useful stuff. show extensions is by far most relevant for typical user + some extensions of the free func api (more complete spline and loft options).

@lorenzncode
Copy link
Member

Is this trim result correct?

pts = [
    (0, 0),
    (1, 0),
    (0, 1),
]

f1 = face(polygon(*pts))
f2 = f1.trim(0, 0.5, 0, 1)
print(f2.Area())  # this returns 0.5; I was expecting 0.375 which is the area of f1 * f2 here?

tests/test_vis.py Outdated Show resolved Hide resolved
builder.Init(True, ruled)
builder = _make_builder(True)

# used to check is building inner parts makes sense
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# used to check is building inner parts makes sense
# used to check if building inner parts makes sense

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adam-urbanczyk !

@adam-urbanczyk
Copy link
Member Author

adam-urbanczyk commented Nov 11, 2024

Is this trim result correct?

pts = [
    (0, 0),
    (1, 0),
    (0, 1),
]

f1 = face(polygon(*pts))
f2 = f1.trim(0, 0.5, 0, 1)
print(f2.Area())  # this returns 0.5; I was expecting 0.375 which is the area of f1 * f2 here?

It is, trim trims the base geometry.

afbeelding

I added a small clarification in the docstrings.

@adam-urbanczyk
Copy link
Member Author

@lorenzncode I think everything is fixed, anything against merging?

Copy link
Member

@lorenzncode lorenzncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adam-urbanczyk! Yes please go ahead. Do you want to link the font issue with this PR? #1639 can be closed with this too.

@adam-urbanczyk adam-urbanczyk merged commit a175cb8 into master Nov 11, 2024
6 checks passed
@adam-urbanczyk adam-urbanczyk added the text rendering Features and issues related to text rendering label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cq.Shape free func text rendering Features and issues related to text rendering vis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants