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

New unit request: Pitch for screw threads #654

Closed
BernhardJosef opened this issue Apr 17, 2019 · 6 comments
Closed

New unit request: Pitch for screw threads #654

BernhardJosef opened this issue Apr 17, 2019 · 6 comments

Comments

@BernhardJosef
Copy link

I'm developping measurement software for screw thread measurement. I need a unit for pitch.
The pitch is measured in millimeters or inches per single turn [mm] or [in] in Europe; in US Turns Per Inch [TPI] is used (https://en.wikipedia.org/wiki/Unified_Thread_Standard).
Especially in Germany [Zoll] or ["] is used as a synonym for [in].

@angularsen
Copy link
Owner

angularsen commented Apr 18, 2019

Hi and thanks for reaching out. I think this is the kind of unit that fall outside the 80/20 rule - we want a library that covers most people's needs with not too many quantities and units. There are so many variations of "X per Y" units that the library would grow very big in binary size if we included them all. Very narrow or application specific units should rather be defined per application.

There is some limited ability to reuse Units.NET infrastructure for custom quantities and units. You can map unit enums and unit abbreviations:

UnitAbbreviationsCache.Default.MapUnitToAbbreviation(MyQuantityUnit.MyUnit1, "myUnitAbbreviation1");
Assert.Equal(MyQuantityUnit.MyUnit1, UnitParser.Default.Parse<MyQuantityUnit>("myUnitAbbreviation1"));

But parsing, constructing and converting quantities is still work in progress in #588 so you may be interested in subscribing to that thread for updates.

@lipchev
Copy link
Collaborator

lipchev commented Apr 18, 2019

Not that I would want to (insert colorful expression here) but wouldn't the same arguments that I made for #646 apply here as well?

  1. Operators : converting linear <-> rotary motion- for example use the RotationalSpeed of a motor to get "Distance"|"Speed" etc.
  2. There is a lot of converting between US and SI units in this domain- compared to the chemical industry it seems the me that the imperial unit's popularity is overwhelming (plenty of converters out there)
  3. Parsing- the author didn't specify this need explicitly- but did give an example of a synonym that seems appropriate mapping to a regional system.

@angularsen
Copy link
Owner

@lipchev Fair points, maybe I was a bit too quick to disregard it as not common enough.
I don't have time to respond or think through it right now, will get back to you both.

@angularsen
Copy link
Owner

angularsen commented Apr 18, 2019

If I read the wiki right, a screw is defined by two values; diameter and pitch. I believe diameter can be represented by Length. Pitch is defined as length per turn - or distance between the threads - and can possibly be represented by Length too?

@BernhardJosef

  1. Could it be sufficient to use Length for diameter and pitch?

  2. You mention Zoll or " as German localizations for in. Would it work to add that to LengthUnit.Inch unit or is it screw thread specific?

  3. Could you perhaps show a pseudo code of the calculations or quantity representations you want do do, that you can't solve with Units.NET today? I'm really just trying to get a better understanding of the value it brings to add these units to the library as we have to make sure it's something that will benefit many 😃

@angularsen
Copy link
Owner

@BernhardJosef Do you have any thoughts on my last comment?

@stale
Copy link

stale bot commented Sep 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 24, 2019
@stale stale bot closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants