Translate

docs/0.4/openscad/connectors
### Adding a connector function in the scad file
SourceTranslationState
108
[<img alt="Successful installation" src="{{ static(openscad-installation.png) }}" />]({{ static(openscad-installation.png) }})
109
How to add connectors
110

This page shows you how to add connectors for a part, for which a OpenSCAD
[basemodule]({{ doc(openscad,basemodule) }}) exists. It continues the example
from the [basemodule guide]({{ doc(openscad,basemodule) }})
111
[Connectors]({{ doc(openscad,usage) }})
simplify the positioning of parts in OpenSCAD, but require a bit of
preparation. Three things need to be added:
112
- a function for the connectors in the scad file
- a entry in the base file
- drawings for the documentation.
113
### Adding a connector function in the scad file
114
The function is added to the `.scad` file, and calculates the position and
orientation for the various connector locations from the parameters of the
model. It returns a list containing as first element the origin of the
coordinate system in terms of global coordinates, as second element a list with
two directions for the first and second direction of the connector. In case the
direction is unknown, the function should return "Error".
115
For the pipes ths function could look like this:
116
function pipeConn(l,location) =
(location == "front-in") ? [[0,0,-l/2],[[0,0,1],[1,0,0]]] :
(location == "front-out") ? [[0,0,-l/2],[[0,0,-1],[-1,0,0]]] :
(location == "back-in") ? [[0,0,+l/2],[[0,0,-1],[-1,0,0]]] :
(location == "back-out") ? [[0,0,+l/2],[[0,0,1],[1,0,0]]] :
"Error";
117
Here only the origin of the connector depends on the length of the pipe, but
for other locations other parameters might be required. The function can make
use of all parameters that are available to the geometry modules in addition to
the location, and the order in which these are passed to the function is not
relevant.
118
### Add an entry in the base file
6 months ago Anonymous user has suggested
### Ajout d'un connecteur dans le fichier scad

Suggested change:

### Ajout d'un connecteur dans le fichier scad

Loading…

Things to check

Glossary

Source Translation
No related strings were found in the glossary.

Source information

Comments
docs/0.4/openscad/connectors
Source string age
3 years ago
Translation file
translations/fr/LC_MESSAGES/docs.po, translation unit 113
String priority
Medium