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

Canonical struct naming #39

Open
virtualritz opened this issue Feb 20, 2023 · 5 comments
Open

Canonical struct naming #39

virtualritz opened this issue Feb 20, 2023 · 5 comments

Comments

@virtualritz
Copy link
Contributor

See Rust API naming guidelines.

In UpperCamelCase, acronyms and contractions of compound words count as one word: use Uuid rather than UUID, Usize rather than USize or Stdin rather than StdIn.

For example in stl.rs:

STLFace -> StlFace
STLReader -> StlReader

STLType -> StlType
STLType::ASCII -> StlType::Ascii

etc.

Would you consider a PR with such changes if I opened one?

@virtualritz virtualritz changed the title Canonical Struct naming Canonical struct naming Feb 20, 2023
@ytanimura
Copy link
Contributor

Thank you for your issue.

If there is something official as evidence, we will try to follow it. It would be helpful if you could give me a pull request.

We would like to specify in advance. For single letter + complete word combinations, we will consider the first letter and the complete word as separate words. Official Rust APIs include, for example, BTreeMap. For example, in truck,

  • Use BSplineHoge rather than BsplineHoge.
  • Use PCurve rather than Pcurve.

@virtualritz
Copy link
Contributor Author

Another thing I noted is the naming of composite structs. I.e. usually the type of geometry the struct holds is at the end of the name. For example: NurbsSurface. It holds a surface.

But RevolutedCurve also holds a surface. So it should be named RevolutedSurface or RevolutedCurveSurface?
Or am I missing something?

@ytanimura
Copy link
Contributor

ytanimura commented Feb 24, 2023

Well, that's what I was struggling with too. What is being rotated here is a curve, not a surface, and a RevolutedSurface should point to S^2xS^1 in R^4, for example. However, SurfaceOfRevolution seems a bit old-fashioned as a class name.. I wish there was some more natural way to describe it.

@virtualritz
Copy link
Contributor Author

virtualritz commented Mar 6, 2023

[...] I still think is_curve_included is a bit ungrammatical. If I had to say, is_including? [...]

The word including is not used in this context much in English at all. Most CAD apps I used have a concept of "a curve on surface".

Maybe you can clarify first what this predicate tests and then we can better ponder a good name?
I assumed it returns true only if the curve is whitin the 2D domain of the surface? But now I can't find the method any more after the latest pull. Was it renamed or removed?

@virtualritz
Copy link
Contributor Author

On that note. I saw is_geometric_consistent(). I think this should be is_geometrically_consistent or maybe it could be abbreviated to is_geo_consistent()?

I.e. there is the geometric consistency and if that is true then the resp. shape is geometrically consistent.

@virtualritz virtualritz mentioned this issue Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants