Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnwebbcole/jscad-hardware
jscad library project of common hardware, bolts and washers
https://github.com/johnwebbcole/jscad-hardware
jscad
Last synced: about 1 month ago
JSON representation
jscad library project of common hardware, bolts and washers
- Host: GitHub
- URL: https://github.com/johnwebbcole/jscad-hardware
- Owner: johnwebbcole
- Created: 2017-03-12T22:04:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T23:01:00.000Z (almost 2 years ago)
- Last Synced: 2024-04-26T13:40:57.595Z (8 months ago)
- Topics: jscad
- Language: JavaScript
- Size: 2.64 MB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![view on npm](http://img.shields.io/npm/v/jscad-hardware.svg)](https://www.npmjs.org/package/jscad-hardware) [![npm module downloads](http://img.shields.io/npm/dt/jscad-hardware.svg)](https://www.npmjs.org/package/jscad-hardware)
# jscad-hardware
> https://johnwebbcole.github.io/jscad-hardware/
![bplus example](docs/jscad-hardware.png)
This is a collection of jscad parts that model a common Imperial and Metric bolts and washers. These models use the [jscad-utils](https://github.com/johnwebbcole/jscad-utils) library and return jscad-utils [`group` objects](https://github.com/johnwebbcole/jscad-utils#utilgroupnames-objects--object).
## Installation
Install `jscad-hardware` using NPM:```bash
npm install --save jscad-hardware
```## Basic usage
To use the utilities, you need to include the `jscad-hardware.jscad`.```javascript
include('node_modules/jscad-utils/jscad-utils.jscad');
include('node_modules/jscad-hardware/jscad-hardware.jscad');main() {
util.init(CSG);var bolt = Hardware.Bolt(
util.inch(1),
ImperialBolts['5/16 hex'],
'close'
)return bolt.combine('head,thread');
}
```## Yeoman Generator
You can use the [yeoman jscad generator](https://www.npmjs.com/package/generator-jscad) which will create a project that uses this library.Once you create your project, install `jscad-hardware`, and run `gulp`. Dragging the `dist` directory into [http://openjscad.org/](http://openjscad.org/) will include this library.
Modify your `main.jscad` file to return a bolt object.
```javascript
function main() {
util.init(CSG);var bolt = Hardware.Bolt(
util.inch(1),
ImperialBolts['5/16 hex'],
'close'
)return bolt.combine('head,thread');
}// include:js
// endinject
```![bplus example](docs/bolt.png)