mirror of
https://github.com/csirmaz/openscad-py.git
synced 2025-06-22 02:38:57 +02:00
Moved documentation to github pages
This commit is contained in:
parent
65a725ce31
commit
4193f2956b
25 changed files with 20 additions and 6297 deletions
|
@ -1,287 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.circle API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.circle</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.circle.Circle"><code class="flex name class">
|
||||
<span>class <span class="ident">Circle</span></span>
|
||||
<span>(</span><span>r: float, fn: int | None = None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 2D primitive, circle.
|
||||
Creates a circle (or regular polygon) at the origin.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#circle">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#circle</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Circle(Object):
|
||||
"""A 2D primitive, circle.
|
||||
Creates a circle (or regular polygon) at the origin.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#circle
|
||||
"""
|
||||
|
||||
def __init__(self, r: float, fn: TUnion[int, None] = None):
|
||||
self.r = r
|
||||
self.fn = fn
|
||||
# $fa, $fs, $fn
|
||||
|
||||
@classmethod
|
||||
def triangle(cls, r):
|
||||
"""Create a regular triangle"""
|
||||
return cls(r=r, fn=3)
|
||||
|
||||
@classmethod
|
||||
def regular_polygon(cls, r, sides: int):
|
||||
"""Create a regular polygon"""
|
||||
return cls(r=r, fn=sides)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
fnstr = '' if self.fn is None else f", $fn={self.fn}"
|
||||
return f"circle(r={self.r}{fnstr});"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.circle.Circle.regular_polygon"><code class="name flex">
|
||||
<span>def <span class="ident">regular_polygon</span></span>(<span>r, sides: int)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a regular polygon</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.triangle"><code class="name flex">
|
||||
<span>def <span class="ident">triangle</span></span>(<span>r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a regular triangle</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.circle.Circle.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.circle.Circle.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.circle.Circle" href="#openscad_py.circle.Circle">Circle</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.circle.Circle.color" href="object_.html#openscad_py.circle.Circle.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.delta_offset" href="object_.html#openscad_py.circle.Circle.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.diff" href="object_.html#openscad_py.circle.Circle.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.extrude" href="object_.html#openscad_py.circle.Circle.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.intersection" href="object_.html#openscad_py.circle.Circle.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.move" href="object_.html#openscad_py.circle.Circle.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.radial_offset" href="object_.html#openscad_py.circle.Circle.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.regular_polygon" href="#openscad_py.circle.Circle.regular_polygon">regular_polygon</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.render" href="#openscad_py.circle.Circle.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.rotate" href="object_.html#openscad_py.circle.Circle.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.rotate_extrude" href="object_.html#openscad_py.circle.Circle.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.scale" href="object_.html#openscad_py.circle.Circle.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.translate" href="object_.html#openscad_py.circle.Circle.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.triangle" href="#openscad_py.circle.Circle.triangle">triangle</a></code></li>
|
||||
<li><code><a title="openscad_py.circle.Circle.union" href="object_.html#openscad_py.circle.Circle.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,271 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.collection API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.collection</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.collection.Collection"><code class="flex name class">
|
||||
<span>class <span class="ident">Collection</span></span>
|
||||
<span>(</span><span>coll: list)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a collection of objects</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Collection(Object):
|
||||
"""Represents a collection of objects"""
|
||||
|
||||
def __init__(self, coll: list):
|
||||
self.collection = coll
|
||||
|
||||
@classmethod
|
||||
def c(cls, coll: TUnion[list, Object]) -> Object:
|
||||
"""Ensure the list of objects is a Collection (idempotent)"""
|
||||
if isinstance(coll, Object):
|
||||
return coll
|
||||
return cls(coll)
|
||||
|
||||
def _add(self, obj):
|
||||
return self.__class__(self.collection + [obj])
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return "\n".join([o.render() for o in self.collection])</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.collection.Collection.c"><code class="name flex">
|
||||
<span>def <span class="ident">c</span></span>(<span>coll: list | <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Ensure the list of objects is a Collection (idempotent)</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.collection.Collection.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.collection.Collection.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.collection.Collection" href="#openscad_py.collection.Collection">Collection</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.collection.Collection.c" href="#openscad_py.collection.Collection.c">c</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.color" href="object_.html#openscad_py.collection.Collection.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.delta_offset" href="object_.html#openscad_py.collection.Collection.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.diff" href="object_.html#openscad_py.collection.Collection.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.extrude" href="object_.html#openscad_py.collection.Collection.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.intersection" href="object_.html#openscad_py.collection.Collection.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.move" href="object_.html#openscad_py.collection.Collection.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.radial_offset" href="object_.html#openscad_py.collection.Collection.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.render" href="#openscad_py.collection.Collection.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.rotate" href="object_.html#openscad_py.collection.Collection.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.rotate_extrude" href="object_.html#openscad_py.collection.Collection.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.scale" href="object_.html#openscad_py.collection.Collection.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.translate" href="object_.html#openscad_py.collection.Collection.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.collection.Collection.union" href="object_.html#openscad_py.collection.Collection.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,255 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.color API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.color</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.color.Color"><code class="flex name class">
|
||||
<span>class <span class="ident">Color</span></span>
|
||||
<span>(</span><span>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>,<br>r: float,<br>g: float,<br>b: float,<br>a: float = 1.0)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a color applied to an object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Color(Object):
|
||||
"""Represents a color applied to an object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color
|
||||
"""
|
||||
|
||||
def __init__(self, child: Object, r: float, g: float, b: float, a: float = 1.):
|
||||
self.color = [r, g, b, a]
|
||||
self.child = child
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"color(c=[{','.join([str(c) for c in self.color])}]){{ {self.child.render()} }}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.color.Color.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.color.Color.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.color.Color" href="#openscad_py.color.Color">Color</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.color.Color.color" href="object_.html#openscad_py.color.Color.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.delta_offset" href="object_.html#openscad_py.color.Color.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.diff" href="object_.html#openscad_py.color.Color.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.extrude" href="object_.html#openscad_py.color.Color.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.intersection" href="object_.html#openscad_py.color.Color.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.move" href="object_.html#openscad_py.color.Color.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.radial_offset" href="object_.html#openscad_py.color.Color.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.render" href="#openscad_py.color.Color.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.rotate" href="object_.html#openscad_py.color.Color.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.rotate_extrude" href="object_.html#openscad_py.color.Color.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.scale" href="object_.html#openscad_py.color.Color.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.translate" href="object_.html#openscad_py.color.Color.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.color.Color.union" href="object_.html#openscad_py.color.Color.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,258 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.cube API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.cube</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.cube.Cube"><code class="flex name class">
|
||||
<span>class <span class="ident">Cube</span></span>
|
||||
<span>(</span><span>size: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>,<br>center: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 3D primitive, cube.
|
||||
Creates a cube in the first octant. When center is true, the cube is centered on the origin.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cube">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cube</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Cube(Object):
|
||||
"""A 3D primitive, cube.
|
||||
Creates a cube in the first octant. When center is true, the cube is centered on the origin.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cube
|
||||
"""
|
||||
|
||||
def __init__(self, size: TUnion[list, Point], center: bool = False):
|
||||
self.size = Point.c(size)
|
||||
self.center = center
|
||||
|
||||
def render(self):
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"cube(size={self.size.render()}, center={self._center()});"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.cube.Cube.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cube.Cube.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.cube.Cube" href="#openscad_py.cube.Cube">Cube</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.cube.Cube.color" href="object_.html#openscad_py.cube.Cube.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.delta_offset" href="object_.html#openscad_py.cube.Cube.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.diff" href="object_.html#openscad_py.cube.Cube.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.extrude" href="object_.html#openscad_py.cube.Cube.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.intersection" href="object_.html#openscad_py.cube.Cube.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.move" href="object_.html#openscad_py.cube.Cube.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.radial_offset" href="object_.html#openscad_py.cube.Cube.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.render" href="#openscad_py.cube.Cube.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.rotate" href="object_.html#openscad_py.cube.Cube.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.rotate_extrude" href="object_.html#openscad_py.cube.Cube.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.scale" href="object_.html#openscad_py.cube.Cube.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.translate" href="object_.html#openscad_py.cube.Cube.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.cube.Cube.union" href="object_.html#openscad_py.cube.Cube.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,292 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.cylinder API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.cylinder</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.cylinder.Cylinder"><code class="flex name class">
|
||||
<span>class <span class="ident">Cylinder</span></span>
|
||||
<span>(</span><span>h, r=None, r1=None, r2=None, center: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 3D primitive, cylinder.
|
||||
Creates a cylinder or cone centered about the z axis. When center is true, it is also centered vertically along the z axis.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cylinder">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cylinder</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Cylinder(Object):
|
||||
"""A 3D primitive, cylinder.
|
||||
Creates a cylinder or cone centered about the z axis. When center is true, it is also centered vertically along the z axis.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#cylinder
|
||||
"""
|
||||
|
||||
def __init__(self, h, r=None, r1=None, r2=None, center: bool = False):
|
||||
self.height = h
|
||||
self.r1 = r if r1 is None else r1
|
||||
self.r2 = r if r2 is None else r2
|
||||
self.center = center
|
||||
# $fa, $fs, $fn
|
||||
|
||||
def render(self):
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"cylinder(h={self.height}, r1={self.r1}, r2={self.r2}, center={self._center()});"
|
||||
|
||||
@classmethod
|
||||
def from_ends(cls, radius: float, p1: TUnion[list, Point], p2: TUnion[list, Point]) -> Object:
|
||||
"""Construct a cylinder between two points"""
|
||||
p1 = Point.c(p1)
|
||||
p2 = Point.c(p2)
|
||||
v = p2.sub(p1)
|
||||
length = v.length()
|
||||
assert length != 0
|
||||
z = Point([0, 0, 1])
|
||||
r = z.cross(v)
|
||||
rangle = v.angle(z)
|
||||
if r.length() == 0:
|
||||
# The cylinder is in the Z direction
|
||||
if abs(abs(rangle) - 180.) < .1:
|
||||
p1 = p2
|
||||
rangle = 0
|
||||
r = z
|
||||
else:
|
||||
r = r.norm()
|
||||
return cls(h=length, r=radius, center=False).rotate(a=rangle, v=r).move(p1)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.cylinder.Cylinder.from_ends"><code class="name flex">
|
||||
<span>def <span class="ident">from_ends</span></span>(<span>radius: float,<br>p1: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>,<br>p2: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Construct a cylinder between two points</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.cylinder.Cylinder.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.cylinder.Cylinder.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.cylinder.Cylinder" href="#openscad_py.cylinder.Cylinder">Cylinder</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.color" href="object_.html#openscad_py.cylinder.Cylinder.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.delta_offset" href="object_.html#openscad_py.cylinder.Cylinder.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.diff" href="object_.html#openscad_py.cylinder.Cylinder.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.extrude" href="object_.html#openscad_py.cylinder.Cylinder.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.from_ends" href="#openscad_py.cylinder.Cylinder.from_ends">from_ends</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.intersection" href="object_.html#openscad_py.cylinder.Cylinder.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.move" href="object_.html#openscad_py.cylinder.Cylinder.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.radial_offset" href="object_.html#openscad_py.cylinder.Cylinder.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.render" href="#openscad_py.cylinder.Cylinder.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.rotate" href="object_.html#openscad_py.cylinder.Cylinder.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.rotate_extrude" href="object_.html#openscad_py.cylinder.Cylinder.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.scale" href="object_.html#openscad_py.cylinder.Cylinder.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.translate" href="object_.html#openscad_py.cylinder.Cylinder.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder.Cylinder.union" href="object_.html#openscad_py.cylinder.Cylinder.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.delta_offset API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.delta_offset</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset"><code class="flex name class">
|
||||
<span>class <span class="ident">DeltaOffset</span></span>
|
||||
<span>(</span><span>delta,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>,<br>chamfer: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A new 2d interior or exterior outline from an existing outline</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class DeltaOffset(Object):
|
||||
"""A new 2d interior or exterior outline from an existing outline
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset
|
||||
"""
|
||||
|
||||
def __init__(self, delta, child: Object, chamfer: bool = False):
|
||||
self.delta = delta
|
||||
self.child = child
|
||||
self.chamfer = chamfer
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"offset(delta={delta}, chamfer={'true' if self.chamfer else 'false'}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.delta_offset.DeltaOffset.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.delta_offset.DeltaOffset" href="#openscad_py.delta_offset.DeltaOffset">DeltaOffset</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.color" href="object_.html#openscad_py.delta_offset.DeltaOffset.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.delta_offset" href="object_.html#openscad_py.delta_offset.DeltaOffset.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.diff" href="object_.html#openscad_py.delta_offset.DeltaOffset.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.extrude" href="object_.html#openscad_py.delta_offset.DeltaOffset.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.intersection" href="object_.html#openscad_py.delta_offset.DeltaOffset.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.move" href="object_.html#openscad_py.delta_offset.DeltaOffset.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.radial_offset" href="object_.html#openscad_py.delta_offset.DeltaOffset.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.render" href="#openscad_py.delta_offset.DeltaOffset.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.rotate" href="object_.html#openscad_py.delta_offset.DeltaOffset.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.rotate_extrude" href="object_.html#openscad_py.delta_offset.DeltaOffset.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.scale" href="object_.html#openscad_py.delta_offset.DeltaOffset.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.translate" href="object_.html#openscad_py.delta_offset.DeltaOffset.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset.DeltaOffset.union" href="object_.html#openscad_py.delta_offset.DeltaOffset.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,255 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.difference API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.difference</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.difference.Difference"><code class="flex name class">
|
||||
<span>class <span class="ident">Difference</span></span>
|
||||
<span>(</span><span>subject: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>,<br>tool: list | <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a difference.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Difference(Object):
|
||||
"""Represents a difference.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
|
||||
"""
|
||||
|
||||
def __init__(self, subject: Object, tool: TUnion[list, Object]):
|
||||
self.subject = subject
|
||||
self.tool = Collection.c(tool) # what to remove
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"difference(){{ {self.subject.render()}\n{self.tool.render()} }}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.difference.Difference.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.difference.Difference.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.difference.Difference" href="#openscad_py.difference.Difference">Difference</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.difference.Difference.color" href="object_.html#openscad_py.difference.Difference.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.delta_offset" href="object_.html#openscad_py.difference.Difference.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.diff" href="object_.html#openscad_py.difference.Difference.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.extrude" href="object_.html#openscad_py.difference.Difference.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.intersection" href="object_.html#openscad_py.difference.Difference.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.move" href="object_.html#openscad_py.difference.Difference.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.radial_offset" href="object_.html#openscad_py.difference.Difference.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.render" href="#openscad_py.difference.Difference.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.rotate" href="object_.html#openscad_py.difference.Difference.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.rotate_extrude" href="object_.html#openscad_py.difference.Difference.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.scale" href="object_.html#openscad_py.difference.Difference.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.translate" href="object_.html#openscad_py.difference.Difference.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.difference.Difference.union" href="object_.html#openscad_py.difference.Difference.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,107 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.header API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.header</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.header.Header"><code class="flex name class">
|
||||
<span>class <span class="ident">Header</span></span>
|
||||
<span>(</span><span>quality: str = 'draft')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Render a header (setting global values) of an OpensCAD file</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Header:
|
||||
"""Render a header (setting global values) of an OpensCAD file"""
|
||||
|
||||
|
||||
def __init__(self, quality: str = 'draft'):
|
||||
# See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Circle_resolution:_$fa,_$fs,_and_$fn
|
||||
self.quality = quality
|
||||
|
||||
|
||||
def render(self):
|
||||
"""Return OpenSCAD code"""
|
||||
if self.quality == 'draft':
|
||||
return ""
|
||||
if self.quality == 'mid':
|
||||
return "$fa=12;$fs=0.2;"
|
||||
if self.quality == 'best':
|
||||
return "$fa=6;$fs=0.1;"
|
||||
raise ValueError("Unknown quality")</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.header.Header.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return OpenSCAD code</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.header.Header" href="#openscad_py.header.Header">Header</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="openscad_py.header.Header.render" href="#openscad_py.header.Header.render">render</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,167 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Package <code>openscad_py</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="openscad_py.circle" href="circle.html">openscad_py.circle</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.collection" href="collection.html">openscad_py.collection</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.color" href="color.html">openscad_py.color</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.cube" href="cube.html">openscad_py.cube</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.cylinder" href="cylinder.html">openscad_py.cylinder</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.delta_offset" href="delta_offset.html">openscad_py.delta_offset</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.difference" href="difference.html">openscad_py.difference</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.header" href="header.html">openscad_py.header</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.intersection" href="intersection.html">openscad_py.intersection</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.linear_extrude" href="linear_extrude.html">openscad_py.linear_extrude</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.object_" href="object_.html">openscad_py.object_</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.path_tube" href="path_tube.html">openscad_py.path_tube</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.point" href="point.html">openscad_py.point</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.polygon" href="polygon.html">openscad_py.polygon</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.polyhedron" href="polyhedron.html">openscad_py.polyhedron</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.radial_offset" href="radial_offset.html">openscad_py.radial_offset</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.rotate" href="rotate.html">openscad_py.rotate</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.rotate_extrude" href="rotate_extrude.html">openscad_py.rotate_extrude</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.scale" href="scale.html">openscad_py.scale</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.sphere" href="sphere.html">openscad_py.sphere</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.translate" href="translate.html">openscad_py.translate</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="openscad_py.union" href="union.html">openscad_py.union</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py.circle" href="circle.html">openscad_py.circle</a></code></li>
|
||||
<li><code><a title="openscad_py.collection" href="collection.html">openscad_py.collection</a></code></li>
|
||||
<li><code><a title="openscad_py.color" href="color.html">openscad_py.color</a></code></li>
|
||||
<li><code><a title="openscad_py.cube" href="cube.html">openscad_py.cube</a></code></li>
|
||||
<li><code><a title="openscad_py.cylinder" href="cylinder.html">openscad_py.cylinder</a></code></li>
|
||||
<li><code><a title="openscad_py.delta_offset" href="delta_offset.html">openscad_py.delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.difference" href="difference.html">openscad_py.difference</a></code></li>
|
||||
<li><code><a title="openscad_py.header" href="header.html">openscad_py.header</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection" href="intersection.html">openscad_py.intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude" href="linear_extrude.html">openscad_py.linear_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.object_" href="object_.html">openscad_py.object_</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube" href="path_tube.html">openscad_py.path_tube</a></code></li>
|
||||
<li><code><a title="openscad_py.point" href="point.html">openscad_py.point</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon" href="polygon.html">openscad_py.polygon</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron" href="polyhedron.html">openscad_py.polyhedron</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset" href="radial_offset.html">openscad_py.radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate" href="rotate.html">openscad_py.rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude" href="rotate_extrude.html">openscad_py.rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.scale" href="scale.html">openscad_py.scale</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere" href="sphere.html">openscad_py.sphere</a></code></li>
|
||||
<li><code><a title="openscad_py.translate" href="translate.html">openscad_py.translate</a></code></li>
|
||||
<li><code><a title="openscad_py.union" href="union.html">openscad_py.union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,254 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.intersection API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.intersection</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.intersection.Intersection"><code class="flex name class">
|
||||
<span>class <span class="ident">Intersection</span></span>
|
||||
<span>(</span><span>child: list | <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents an intersection applied to an object (usually a collection of objects).
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Intersection(Object):
|
||||
"""Represents an intersection applied to an object (usually a collection of objects).
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
|
||||
"""
|
||||
|
||||
def __init__(self, child: TUnion[Object, list]):
|
||||
self.child = Collection.c(child)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"intersection(){{ {self.child.render()} }}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.intersection.Intersection.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.intersection.Intersection.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.intersection.Intersection" href="#openscad_py.intersection.Intersection">Intersection</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.intersection.Intersection.color" href="object_.html#openscad_py.intersection.Intersection.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.delta_offset" href="object_.html#openscad_py.intersection.Intersection.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.diff" href="object_.html#openscad_py.intersection.Intersection.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.extrude" href="object_.html#openscad_py.intersection.Intersection.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.intersection" href="object_.html#openscad_py.intersection.Intersection.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.move" href="object_.html#openscad_py.intersection.Intersection.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.radial_offset" href="object_.html#openscad_py.intersection.Intersection.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.render" href="#openscad_py.intersection.Intersection.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.rotate" href="object_.html#openscad_py.intersection.Intersection.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.rotate_extrude" href="object_.html#openscad_py.intersection.Intersection.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.scale" href="object_.html#openscad_py.intersection.Intersection.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.translate" href="object_.html#openscad_py.intersection.Intersection.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.intersection.Intersection.union" href="object_.html#openscad_py.intersection.Intersection.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,258 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.linear_extrude API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.linear_extrude</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude"><code class="flex name class">
|
||||
<span>class <span class="ident">LinearExtrude</span></span>
|
||||
<span>(</span><span>height,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>,<br>convexity: int = 10,<br>center: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a linear extrusion applied to an object.
|
||||
If center is false the linear extrusion Z range is from 0 to height; if it is true, the range is from -height/2 to height/2.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class LinearExtrude(Object):
|
||||
"""Represents a linear extrusion applied to an object.
|
||||
If center is false the linear extrusion Z range is from 0 to height; if it is true, the range is from -height/2 to height/2.
|
||||
"""
|
||||
|
||||
def __init__(self, height, child: Object, convexity: int = 10, center: bool = False):
|
||||
self.height = height
|
||||
self.child = child
|
||||
self.convexity = convexity
|
||||
self.center = center
|
||||
# twist, slices, scale (float/vector), $fn
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"linear_extrude(height={self.height}, center={self._center()}, convexity={self.convexity}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.linear_extrude.LinearExtrude.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.linear_extrude.LinearExtrude" href="#openscad_py.linear_extrude.LinearExtrude">LinearExtrude</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.color" href="object_.html#openscad_py.linear_extrude.LinearExtrude.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.delta_offset" href="object_.html#openscad_py.linear_extrude.LinearExtrude.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.diff" href="object_.html#openscad_py.linear_extrude.LinearExtrude.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.extrude" href="object_.html#openscad_py.linear_extrude.LinearExtrude.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.intersection" href="object_.html#openscad_py.linear_extrude.LinearExtrude.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.move" href="object_.html#openscad_py.linear_extrude.LinearExtrude.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.radial_offset" href="object_.html#openscad_py.linear_extrude.LinearExtrude.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.render" href="#openscad_py.linear_extrude.LinearExtrude.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.rotate" href="object_.html#openscad_py.linear_extrude.LinearExtrude.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.rotate_extrude" href="object_.html#openscad_py.linear_extrude.LinearExtrude.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.scale" href="object_.html#openscad_py.linear_extrude.LinearExtrude.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.translate" href="object_.html#openscad_py.linear_extrude.LinearExtrude.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.linear_extrude.LinearExtrude.union" href="object_.html#openscad_py.linear_extrude.LinearExtrude.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,310 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.object_ API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.object_</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.object_.Object"><code class="flex name class">
|
||||
<span>class <span class="ident">Object</span></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Base class for an SCAD object. Defines convenience methods to apply transformations.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Object:
|
||||
"""Base class for an SCAD object. Defines convenience methods to apply transformations."""
|
||||
|
||||
def _center(self) -> str:
|
||||
"""Render the `center` flag into string"""
|
||||
return ('true' if self.center else 'false')
|
||||
|
||||
def _add(self, obj: 'Object'):
|
||||
"""Add an object, forming a Collection"""
|
||||
from openscad_py.collection import Collection
|
||||
return Collection([self, obj])
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
raise Exception("abstract method")
|
||||
|
||||
def translate(self, v: TUnion[list, Point]) -> 'Object':
|
||||
"""Apply a translation and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate
|
||||
"""
|
||||
from openscad_py.translate import Translate
|
||||
return Translate(v=v, child=self)
|
||||
|
||||
def move(self, v: TUnion[list, Point]) -> 'Object':
|
||||
"""Apply a translation and return a new object. Synonym of `translate()`"""
|
||||
from openscad_py.translate import Translate
|
||||
return Translate(v=v, child=self)
|
||||
|
||||
def rotate(self, a, v: TUnion[list, Point]) -> 'Object':
|
||||
"""Apply a rotation and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
|
||||
"""
|
||||
from openscad_py.rotate import Rotate
|
||||
return Rotate(a=a, v=v, child=self)
|
||||
|
||||
def scale(self, v: TUnion[list, Point, float]) -> 'Object':
|
||||
"""Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale
|
||||
"""
|
||||
from openscad_py.scale import Scale
|
||||
return Scale(v=v, child=self)
|
||||
|
||||
def color(self, r, g, b, a=1.) -> 'Object':
|
||||
"""Apply a color and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color
|
||||
"""
|
||||
from openscad_py.color import Color
|
||||
return Color(r=r, g=g, b=b, a=a, child=self)
|
||||
|
||||
def extrude(self, height, convexity = 10, center: bool = False) -> 'Object':
|
||||
"""Apply a linear extrusion and return a new object.
|
||||
If `center` is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is from -height/2 to height/2.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion
|
||||
"""
|
||||
from openscad_py.linear_extrude import LinearExtrude
|
||||
return LinearExtrude(height=height, child=self, convexity=convexity, center=center)
|
||||
|
||||
def rotate_extrude(self, angle, convexity = 10) -> 'Object':
|
||||
"""Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion
|
||||
"""
|
||||
from openscad_py.rotate_extrude import RotateExtrude
|
||||
return RotateExtrude(angle=angle, child=self, convexity=convexity)
|
||||
|
||||
def radial_offset(self, r):
|
||||
"""Return a new 2D interior or exterior outline from an existing outline.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset
|
||||
"""
|
||||
from openscad_py.radial_offset import RadialOffset
|
||||
return RadialOffset(r=r, child=self)
|
||||
|
||||
def delta_offset(self, delta, chamfer=False):
|
||||
"""Return a new 2D interior or exterior outline from an existing outline.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset
|
||||
"""
|
||||
from openscad_py.delta_offset import DeltaOffset
|
||||
return DeltaOffset(delta=delta, child=self, chamfer=chamfer)
|
||||
|
||||
def diff(self, tool: TUnion[list, 'Object']) -> 'Object':
|
||||
"""Remove from the object using a difference operator, and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference
|
||||
"""
|
||||
from openscad_py.difference import Difference
|
||||
return Difference(subject=self, tool=tool)
|
||||
|
||||
def union(self, objects: TUnion[list, 'Object']) -> 'Object':
|
||||
"""Form the union of self and an object or list of objects, and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union
|
||||
"""
|
||||
from openscad_py.union import Union
|
||||
from openscad_py.collection import Collection
|
||||
return Union(child=Collection.c(objects)._add(self))
|
||||
|
||||
def intersection(self, objects: TUnion[list, 'Object']) -> 'Object':
|
||||
"""Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection
|
||||
"""
|
||||
from openscad_py.intersection import Intersection
|
||||
from openscad_py.collection import Collection
|
||||
return Intersection(child=Collection.c(objects)._add(self))</code></pre>
|
||||
</details>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.circle.Circle" href="circle.html#openscad_py.circle.Circle">Circle</a></li>
|
||||
<li><a title="openscad_py.collection.Collection" href="collection.html#openscad_py.collection.Collection">Collection</a></li>
|
||||
<li><a title="openscad_py.color.Color" href="color.html#openscad_py.color.Color">Color</a></li>
|
||||
<li><a title="openscad_py.cube.Cube" href="cube.html#openscad_py.cube.Cube">Cube</a></li>
|
||||
<li><a title="openscad_py.cylinder.Cylinder" href="cylinder.html#openscad_py.cylinder.Cylinder">Cylinder</a></li>
|
||||
<li><a title="openscad_py.delta_offset.DeltaOffset" href="delta_offset.html#openscad_py.delta_offset.DeltaOffset">DeltaOffset</a></li>
|
||||
<li><a title="openscad_py.difference.Difference" href="difference.html#openscad_py.difference.Difference">Difference</a></li>
|
||||
<li><a title="openscad_py.intersection.Intersection" href="intersection.html#openscad_py.intersection.Intersection">Intersection</a></li>
|
||||
<li><a title="openscad_py.linear_extrude.LinearExtrude" href="linear_extrude.html#openscad_py.linear_extrude.LinearExtrude">LinearExtrude</a></li>
|
||||
<li><a title="openscad_py.path_tube.PathTube" href="path_tube.html#openscad_py.path_tube.PathTube">PathTube</a></li>
|
||||
<li><a title="openscad_py.polygon.Polygon" href="polygon.html#openscad_py.polygon.Polygon">Polygon</a></li>
|
||||
<li><a title="openscad_py.polyhedron.Polyhedron" href="polyhedron.html#openscad_py.polyhedron.Polyhedron">Polyhedron</a></li>
|
||||
<li><a title="openscad_py.radial_offset.RadialOffset" href="radial_offset.html#openscad_py.radial_offset.RadialOffset">RadialOffset</a></li>
|
||||
<li><a title="openscad_py.rotate.Rotate" href="rotate.html#openscad_py.rotate.Rotate">Rotate</a></li>
|
||||
<li><a title="openscad_py.rotate_extrude.RotateExtrude" href="rotate_extrude.html#openscad_py.rotate_extrude.RotateExtrude">RotateExtrude</a></li>
|
||||
<li><a title="openscad_py.scale.Scale" href="scale.html#openscad_py.scale.Scale">Scale</a></li>
|
||||
<li><a title="openscad_py.sphere.Sphere" href="sphere.html#openscad_py.sphere.Sphere">Sphere</a></li>
|
||||
<li><a title="openscad_py.translate.Translate" href="translate.html#openscad_py.translate.Translate">Translate</a></li>
|
||||
<li><a title="openscad_py.union.Union" href="union.html#openscad_py.union.Union">Union</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.object_.Object.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#difference</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is from -height/2 to height/2.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#intersection</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.object_.Object.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union</a></p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.object_.Object" href="#openscad_py.object_.Object">Object</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.object_.Object.color" href="#openscad_py.object_.Object.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.delta_offset" href="#openscad_py.object_.Object.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.diff" href="#openscad_py.object_.Object.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.extrude" href="#openscad_py.object_.Object.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.intersection" href="#openscad_py.object_.Object.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.move" href="#openscad_py.object_.Object.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.radial_offset" href="#openscad_py.object_.Object.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.render" href="#openscad_py.object_.Object.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.rotate" href="#openscad_py.object_.Object.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.rotate_extrude" href="#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.scale" href="#openscad_py.object_.Object.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.translate" href="#openscad_py.object_.Object.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.object_.Object.union" href="#openscad_py.object_.Object.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,367 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.path_tube API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.path_tube</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.path_tube.PathTube"><code class="flex name class">
|
||||
<span>class <span class="ident">PathTube</span></span>
|
||||
<span>(</span><span>points: List[list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>],<br>radius: float | list,<br>fn: int,<br>make_torus: bool = False,<br>convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Creates a tube-like or toroid polyhedron from a path (list of points).</p>
|
||||
<p>points: The list of points
|
||||
radius: A float or a list of floats for each point
|
||||
fn: int, The number of sides
|
||||
make_torus: bool, Whether to make a torus instead of a pipe with ends. Warning: the last segment may be twisted.
|
||||
convexity: see openscad</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class PathTube(Object):
|
||||
"""Creates a tube-like or toroid polyhedron from a path (list of points)."""
|
||||
|
||||
def __init__(self, points: List[TUnion[list, Point]], radius: TUnion[float, list], fn: int, make_torus: bool = False, convexity: int = 10):
|
||||
"""
|
||||
points: The list of points
|
||||
radius: A float or a list of floats for each point
|
||||
fn: int, The number of sides
|
||||
make_torus: bool, Whether to make a torus instead of a pipe with ends. Warning: the last segment may be twisted.
|
||||
convexity: see openscad
|
||||
"""
|
||||
self.points = [Point.c(p) for p in points]
|
||||
self.radii = radius if isinstance(radius, list) else [radius for p in points]
|
||||
self.fn = fn
|
||||
self.make_torus = make_torus
|
||||
self.convexity = convexity
|
||||
|
||||
def process(self, debug: bool = False) -> Polyhedron:
|
||||
"""Generate a Polyhedron object from the parameters"""
|
||||
points_rows = []
|
||||
|
||||
for ix, point in enumerate(self.points):
|
||||
if debug: print(f"//LOOP {ix}: {point.render()}")
|
||||
|
||||
if (not self.make_torus) and ix == 0:
|
||||
# Start of the path
|
||||
v = self.points[1].sub(point) # vector toward the first point
|
||||
z_point = Point([0,0,1])
|
||||
seam = v.cross(z_point) # Track a seam along the pipe using this vector pointing from the middle line
|
||||
if seam.length() == 0: # v is in the z direction
|
||||
seam = Point([1,0,0])
|
||||
seam = seam.norm()
|
||||
seam2 = v.cross(seam).norm()
|
||||
if debug: print(f"//Start. v={v.render()} seam={seam.render()} seam2={seam2.render()}")
|
||||
points = []
|
||||
for i in range(self.fn):
|
||||
a = math.pi*2*i/self.fn
|
||||
points.append((seam*math.cos(a) + seam2*math.sin(a))*self.radii[ix] + point)
|
||||
points_rows.append(points)
|
||||
if debug: print(f"// Row: {', '.join([p.render() for p in points])}")
|
||||
|
||||
elif (not self.make_torus) and ix == len(self.points) - 1:
|
||||
# End of the path
|
||||
v = point.sub(self.points[-2])
|
||||
seam2 = v.cross(seam).norm()
|
||||
if debug: print(f"//End. v={v.render()} seam={seam.render()} seam2={seam2.render()}")
|
||||
points = []
|
||||
for i in range(self.fn):
|
||||
a = math.pi*2*i/self.fn
|
||||
points.append((seam*math.cos(a) + seam2*math.sin(a))*self.radii[ix] + point)
|
||||
points_rows.append(points)
|
||||
if debug: print(f"// Row: {', '.join([p.render() for p in points])}")
|
||||
|
||||
else:
|
||||
# Middle of the path
|
||||
iprev = ix - 1 if ix > 0 else len(self.points) - 1
|
||||
inext = ix + 1 if ix < len(self.points) - 1 else 0
|
||||
# (p[-1]) -va-> (p[0]) -vb-> (p[1])
|
||||
va = point.sub(self.points[iprev]).norm() # vector incoming to this elbow
|
||||
vb = self.points[inext].sub(point).norm() # vector going out from this elbow
|
||||
if debug: print(f"//Middle. va={va.render()} vb={vb.render()}")
|
||||
# Get the vector perpendicular to va that points to the inside of the cylinder around va according
|
||||
# to the elbow at p[0]. This is the component of vb in a basis defined by va.
|
||||
vdot = va.dot(vb)
|
||||
vb_proj = va.scale(vdot) # The projection of vb onto va
|
||||
vb_perp = vb.sub(vb_proj) # This is perpendicular to va
|
||||
if debug: print(f"// vb_proj={vb_proj.render()} vb_perp={vb_perp.render()}")
|
||||
va_inner = vb_perp.norm()
|
||||
|
||||
va_proj = vb.scale(vdot)
|
||||
va_perp = va.sub(va_proj)
|
||||
if debug: print(f"// va_proj={va_proj.render()} va_perp={va_perp.render()}")
|
||||
vb_inner = va_perp.scale(-1).norm() # Here we want to project -va onto vb
|
||||
if debug: print(f"// va_inner={va_inner.render()} vb_inner={vb_inner.render()}")
|
||||
|
||||
if ix == 0:
|
||||
# We just choose a seam when making a torus
|
||||
seam_angle = 0
|
||||
else:
|
||||
# The new seam on vb (seam_b) has the same angle to vb_inner as it had on va to va_inner
|
||||
seam_angle = seam.angle(va_inner, mode="rad")
|
||||
# need to figure out the sign of the angle
|
||||
if seam_angle != 0:
|
||||
if va_inner.cross(seam).dot(va) < 0:
|
||||
seam_angle = -seam_angle
|
||||
vb_inner2 = vb.cross(vb_inner).norm()
|
||||
seam_b = vb_inner*math.cos(seam_angle) + vb_inner2*math.sin(seam_angle)
|
||||
if debug:
|
||||
if ix == 0:
|
||||
print(f"// seam=N/A seam_b={seam_b.render()}")
|
||||
else:
|
||||
print(f"// seam={seam.render()} seam_b={seam_b.render()}")
|
||||
|
||||
vangle = va.scale(-1).angle(vb, mode="rad")
|
||||
long_inner = (vb-va).norm().scale(1/math.sin(vangle/2))
|
||||
# long_inner is the long axis of the elliptic intersection between the cylinders around va and vb
|
||||
short = va.cross(long_inner).norm() # the short axis of the ellipse
|
||||
if debug: print(f"// long_inner={long_inner.render()} short={short.render()} vangle={vangle/math.pi*180}(deg) seam_angle={seam_angle/math.pi*180}(deg)")
|
||||
points = []
|
||||
for i in range(self.fn):
|
||||
# We draw the ellipse according to long_inner and short, but use seam_angle to get the right points
|
||||
a = math.pi*2*i/self.fn + seam_angle
|
||||
points.append((long_inner*math.cos(a) + short*math.sin(a))*self.radii[ix] + point)
|
||||
points_rows.append(points)
|
||||
if debug: print(f"// Row: {', '.join([p.render() for p in points])}")
|
||||
|
||||
seam = seam_b
|
||||
|
||||
return Polyhedron.tube(points=points_rows, convexity=self.convexity, make_torus=self.make_torus)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return self.process().render()</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.path_tube.PathTube.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.process"><code class="name flex">
|
||||
<span>def <span class="ident">process</span></span>(<span>self, debug: bool = False) ‑> <a title="openscad_py.polyhedron.Polyhedron" href="polyhedron.html#openscad_py.polyhedron.Polyhedron">Polyhedron</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generate a Polyhedron object from the parameters</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.path_tube.PathTube.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.path_tube.PathTube" href="#openscad_py.path_tube.PathTube">PathTube</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.color" href="object_.html#openscad_py.path_tube.PathTube.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.delta_offset" href="object_.html#openscad_py.path_tube.PathTube.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.diff" href="object_.html#openscad_py.path_tube.PathTube.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.extrude" href="object_.html#openscad_py.path_tube.PathTube.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.intersection" href="object_.html#openscad_py.path_tube.PathTube.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.move" href="object_.html#openscad_py.path_tube.PathTube.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.process" href="#openscad_py.path_tube.PathTube.process">process</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.radial_offset" href="object_.html#openscad_py.path_tube.PathTube.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.render" href="#openscad_py.path_tube.PathTube.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.rotate" href="object_.html#openscad_py.path_tube.PathTube.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.rotate_extrude" href="object_.html#openscad_py.path_tube.PathTube.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.scale" href="object_.html#openscad_py.path_tube.PathTube.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.translate" href="object_.html#openscad_py.path_tube.PathTube.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.path_tube.PathTube.union" href="object_.html#openscad_py.path_tube.PathTube.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,373 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.point API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.point</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.point.Point"><code class="flex name class">
|
||||
<span>class <span class="ident">Point</span></span>
|
||||
<span>(</span><span>coords)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a point or vector in arbitrary dimensions</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Point:
|
||||
"""Represents a point or vector in arbitrary dimensions"""
|
||||
|
||||
def __init__(self, coords):
|
||||
self.c = np.array(coords, dtype=NP_TYPE)
|
||||
|
||||
@classmethod
|
||||
def c(cls, coords: TUnion[list, 'Point']) -> 'Point':
|
||||
"""Ensure coords is an instance of Point (idempotent)"""
|
||||
if isinstance(coords, Point):
|
||||
return coords
|
||||
return Point(coords)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return "[" + (",".join([str(c) for c in self.c])) + "]"
|
||||
|
||||
def render_stl(self) -> str:
|
||||
return " ".join([str(c) for c in self.c])
|
||||
|
||||
def scale(self, x: float) -> 'Point':
|
||||
"""Scale the current vector/point by a scalar"""
|
||||
return self.__class__(self.c * x)
|
||||
|
||||
def add(self, p: 'Point') -> 'Point':
|
||||
assert isinstance(p, Point)
|
||||
assert self.dim() == p.dim()
|
||||
return self.__class__(self.c + p.c)
|
||||
|
||||
def sub(self, p: 'Point') -> 'Point':
|
||||
assert isinstance(p, Point)
|
||||
assert self.dim() == p.dim()
|
||||
return self.__class__(self.c - p.c)
|
||||
|
||||
def dim(self) -> int:
|
||||
"""Return the number of dimensions"""
|
||||
return self.c.shape[0]
|
||||
|
||||
def is_zero(self) -> bool:
|
||||
"""Return whether all coordinates are very close to 0"""
|
||||
return np.all(np.abs(self.c) < EPSILON)
|
||||
|
||||
def length(self) -> float:
|
||||
"""Return the length of the vector"""
|
||||
return np.sqrt(np.square(self.c).sum())
|
||||
|
||||
def norm(self) -> 'Point':
|
||||
l = self.length()
|
||||
if l == 0:
|
||||
raise Exception("normalising 0 vector")
|
||||
return self.__class__(self.c / self.length())
|
||||
|
||||
def dot(self, p: 'Point') -> float:
|
||||
"""Return the dot product"""
|
||||
return np.dot(self.c, p.c)
|
||||
|
||||
def cross(self, p: 'Point') -> 'Point':
|
||||
"""Return the cross product"""
|
||||
assert self.dim() == 3
|
||||
assert p.dim() == 3
|
||||
return Point([
|
||||
self.c[1]*p.c[2] - self.c[2]*p.c[1],
|
||||
self.c[2]*p.c[0] - self.c[0]*p.c[2],
|
||||
self.c[0]*p.c[1] - self.c[1]*p.c[0]
|
||||
|
||||
])
|
||||
|
||||
def eq(self, p: 'Point') -> bool:
|
||||
return (self.c == p.c).all()
|
||||
|
||||
def lt(self, p: 'Point') -> bool:
|
||||
return (self.c < p.c).all()
|
||||
|
||||
def le(self, p: 'Point') -> bool:
|
||||
return (self.c <= p.c).all()
|
||||
|
||||
def gt(self, p: 'Point') -> bool:
|
||||
return (self.c > p.c).all()
|
||||
|
||||
def ge(self, p: 'Point') -> bool:
|
||||
return (self.c >= p.c).all()
|
||||
|
||||
def allclose(self, p: 'Point') -> bool:
|
||||
return self.c.shape == p.c.shape and np.allclose(self.c, p.c)
|
||||
|
||||
def angle(self, p: 'Point', mode: str = "deg") -> float:
|
||||
"""Return the angle between two vectors in degrees or radians"""
|
||||
r = self.dot(p)
|
||||
r = r / self.length() / p.length()
|
||||
r = math.acos(r)
|
||||
if mode == "rad":
|
||||
return r
|
||||
if mode == "deg":
|
||||
return r / math.pi * 180.
|
||||
raise ValueError("Unknown mode")
|
||||
|
||||
def z_slope(self, mode: str = "deg") -> float:
|
||||
"""Return the slope of a vector in degrees or radians"""
|
||||
r = self.c[2] / self.length()
|
||||
r = math.asin(r)
|
||||
if mode == "rad":
|
||||
return r
|
||||
if mode == "deg":
|
||||
return r / math.pi * 180.
|
||||
raise ValueError("Unknown mode")
|
||||
|
||||
def rotate(self, coords, angle: float) -> 'Point':
|
||||
"""Rotate. coords is a list of 2 coordinate indices that we rotate"""
|
||||
assert len(coords) == 2
|
||||
ca, cb = coords
|
||||
s = np.sin(angle / 180. * np.pi)
|
||||
c = np.cos(angle / 180. * np.pi)
|
||||
r = self.clone().reset_cache()
|
||||
r.c[ca] = c * self.c[ca] + s * self.c[cb]
|
||||
r.c[cb] = -s * self.c[ca] + c * self.c[cb]
|
||||
return r
|
||||
|
||||
# Operator overloading
|
||||
|
||||
def __add__(self, other):
|
||||
return self.add(other)
|
||||
|
||||
def __radd__(self, other):
|
||||
assert isinstance(other, Point)
|
||||
return other.add(self)
|
||||
|
||||
def __sub__(self, other):
|
||||
return self.sub(other)
|
||||
|
||||
def __rsub__(self, other):
|
||||
assert isinstance(other, Point)
|
||||
return other.sub(self)
|
||||
|
||||
def __mul__(self, other):
|
||||
return self.scale(other)
|
||||
|
||||
def __rmul__(self, other):
|
||||
return self.scale(other)
|
||||
|
||||
def __neg__(self):
|
||||
return self.scale(-1.)</code></pre>
|
||||
</details>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.point.Point.c"><code class="name flex">
|
||||
<span>def <span class="ident">c</span></span>(<span>coords: list | ForwardRef('<a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>')) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Ensure coords is an instance of Point (idempotent)</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.point.Point.add"><code class="name flex">
|
||||
<span>def <span class="ident">add</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.allclose"><code class="name flex">
|
||||
<span>def <span class="ident">allclose</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.angle"><code class="name flex">
|
||||
<span>def <span class="ident">angle</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>,<br>mode: str = 'deg') ‑> float</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the angle between two vectors in degrees or radians</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.cross"><code class="name flex">
|
||||
<span>def <span class="ident">cross</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the cross product</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.dim"><code class="name flex">
|
||||
<span>def <span class="ident">dim</span></span>(<span>self) ‑> int</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the number of dimensions</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.dot"><code class="name flex">
|
||||
<span>def <span class="ident">dot</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> float</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the dot product</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.eq"><code class="name flex">
|
||||
<span>def <span class="ident">eq</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.ge"><code class="name flex">
|
||||
<span>def <span class="ident">ge</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.gt"><code class="name flex">
|
||||
<span>def <span class="ident">gt</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.is_zero"><code class="name flex">
|
||||
<span>def <span class="ident">is_zero</span></span>(<span>self) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return whether all coordinates are very close to 0</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.le"><code class="name flex">
|
||||
<span>def <span class="ident">le</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.length"><code class="name flex">
|
||||
<span>def <span class="ident">length</span></span>(<span>self) ‑> float</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the length of the vector</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.lt"><code class="name flex">
|
||||
<span>def <span class="ident">lt</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> bool</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.norm"><code class="name flex">
|
||||
<span>def <span class="ident">norm</span></span>(<span>self) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.render_stl"><code class="name flex">
|
||||
<span>def <span class="ident">render_stl</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self, coords, angle: float) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Rotate. coords is a list of 2 coordinate indices that we rotate</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self, x: float) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Scale the current vector/point by a scalar</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.sub"><code class="name flex">
|
||||
<span>def <span class="ident">sub</span></span>(<span>self,<br>p: <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.point.Point.z_slope"><code class="name flex">
|
||||
<span>def <span class="ident">z_slope</span></span>(<span>self, mode: str = 'deg') ‑> float</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Return the slope of a vector in degrees or radians</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.point.Point" href="#openscad_py.point.Point">Point</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.point.Point.add" href="#openscad_py.point.Point.add">add</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.allclose" href="#openscad_py.point.Point.allclose">allclose</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.angle" href="#openscad_py.point.Point.angle">angle</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.c" href="#openscad_py.point.Point.c">c</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.cross" href="#openscad_py.point.Point.cross">cross</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.dim" href="#openscad_py.point.Point.dim">dim</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.dot" href="#openscad_py.point.Point.dot">dot</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.eq" href="#openscad_py.point.Point.eq">eq</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.ge" href="#openscad_py.point.Point.ge">ge</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.gt" href="#openscad_py.point.Point.gt">gt</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.is_zero" href="#openscad_py.point.Point.is_zero">is_zero</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.le" href="#openscad_py.point.Point.le">le</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.length" href="#openscad_py.point.Point.length">length</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.lt" href="#openscad_py.point.Point.lt">lt</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.norm" href="#openscad_py.point.Point.norm">norm</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.render" href="#openscad_py.point.Point.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.render_stl" href="#openscad_py.point.Point.render_stl">render_stl</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.rotate" href="#openscad_py.point.Point.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.scale" href="#openscad_py.point.Point.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.sub" href="#openscad_py.point.Point.sub">sub</a></code></li>
|
||||
<li><code><a title="openscad_py.point.Point.z_slope" href="#openscad_py.point.Point.z_slope">z_slope</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,253 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.polygon API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.polygon</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.polygon.Polygon"><code class="flex name class">
|
||||
<span>class <span class="ident">Polygon</span></span>
|
||||
<span>(</span><span>points, paths=None, convexity=10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 2D primitive, polygon. Use points/lists with 2 coordinates.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Polygon(Object):
|
||||
"""A 2D primitive, polygon. Use points/lists with 2 coordinates."""
|
||||
|
||||
def __init__(self, points, paths=None, convexity=10):
|
||||
assert paths is None # not implemented yet
|
||||
self.points = [Point.c(p) for p in points]
|
||||
self.convexity = convexity
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"polygon(points=[{','.join([p.render() for p in self.points])}], convexity={self.convexity});"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.polygon.Polygon.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polygon.Polygon.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.polygon.Polygon" href="#openscad_py.polygon.Polygon">Polygon</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.polygon.Polygon.color" href="object_.html#openscad_py.polygon.Polygon.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.delta_offset" href="object_.html#openscad_py.polygon.Polygon.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.diff" href="object_.html#openscad_py.polygon.Polygon.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.extrude" href="object_.html#openscad_py.polygon.Polygon.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.intersection" href="object_.html#openscad_py.polygon.Polygon.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.move" href="object_.html#openscad_py.polygon.Polygon.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.radial_offset" href="object_.html#openscad_py.polygon.Polygon.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.render" href="#openscad_py.polygon.Polygon.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.rotate" href="object_.html#openscad_py.polygon.Polygon.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.rotate_extrude" href="object_.html#openscad_py.polygon.Polygon.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.scale" href="object_.html#openscad_py.polygon.Polygon.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.translate" href="object_.html#openscad_py.polygon.Polygon.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.polygon.Polygon.union" href="object_.html#openscad_py.polygon.Polygon.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,517 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.polyhedron API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.polyhedron</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron"><code class="flex name class">
|
||||
<span>class <span class="ident">Polyhedron</span></span>
|
||||
<span>(</span><span>points: List[list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>],<br>faces: List[list],<br>convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 3D primitive, a polyhedron defined by a list of points and faces.
|
||||
Faces are defined by lists of point indices. The points of a face must be listed clockwise when
|
||||
looking at the face from the outside inward.
|
||||
Nonplanar faces should be triangulated by OpenSCAD.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#polyhedron">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#polyhedron</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Polyhedron(Object):
|
||||
"""A 3D primitive, a polyhedron defined by a list of points and faces.
|
||||
Faces are defined by lists of point indices. The points of a face must be listed clockwise when
|
||||
looking at the face from the outside inward.
|
||||
Nonplanar faces should be triangulated by OpenSCAD.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#polyhedron
|
||||
"""
|
||||
|
||||
def __init__(self, points: List[TUnion[list, Point]], faces: List[list], convexity: int = 10):
|
||||
self.points = [Point.c(p) for p in points]
|
||||
self.faces = faces
|
||||
self.convexity = convexity
|
||||
|
||||
@classmethod
|
||||
def torus(cls, points: List[List[TUnion[list, Point]]], torus_connect_offset: int = 0, convexity: int = 10):
|
||||
"""Construct a torus-like polyhedron from a 2D array of points.
|
||||
Each row of points must be oriented clockwise when looking from the first row (loop) toward the next.
|
||||
The rows of points form loops.
|
||||
|
||||
points: A 2D array of points
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD
|
||||
"""
|
||||
return cls.tube(points=points, convexity=convexity, make_torus=True, torus_connect_offset=torus_connect_offset)
|
||||
|
||||
@classmethod
|
||||
def tube(cls, points: List[List[TUnion[list, Point]]], make_torus: bool = False, torus_connect_offset: int = 0, convexity: int = 10):
|
||||
"""Construct a tube-like polyhedron from a 2D array of points.
|
||||
Each row of points must be oriented clockwise when looking at the pipe at the start inwards.
|
||||
The rows of points form loops.
|
||||
|
||||
points: A 2D array of points
|
||||
make_torus: bool, Whether to create a torus-like shape instead of a pipe with ends
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD
|
||||
"""
|
||||
rows = len(points)
|
||||
row_len = len(points[0])
|
||||
point_list = []
|
||||
point_map = {} # { (row_ix,col_ix) -> list_ix, ...
|
||||
for row_ix, row in enumerate(points):
|
||||
for col_ix, point in enumerate(row):
|
||||
point_map[(row_ix, col_ix)] = len(point_list)
|
||||
point_list.append(point)
|
||||
|
||||
faces = []
|
||||
|
||||
# Side faces
|
||||
for row_ix in range(1, rows):
|
||||
for col_ix in range(1, row_len):
|
||||
faces.append([
|
||||
point_map[(row_ix, col_ix-1)],
|
||||
point_map[(row_ix, col_ix)],
|
||||
point_map[(row_ix-1, col_ix)],
|
||||
point_map[(row_ix-1, col_ix-1)]
|
||||
])
|
||||
faces.append([
|
||||
point_map[(row_ix, row_len-1)],
|
||||
point_map[(row_ix, 0)],
|
||||
point_map[(row_ix-1, 0)],
|
||||
point_map[(row_ix-1, row_len-1)]
|
||||
])
|
||||
|
||||
if not make_torus:
|
||||
|
||||
# Starting cap
|
||||
faces.append([point_map[(0,x)] for x in range(row_len)])
|
||||
# Ending cap
|
||||
faces.append([point_map[(rows-1,row_len-1-x)] for x in range(row_len)])
|
||||
|
||||
else:
|
||||
|
||||
# Connect the end to the start
|
||||
for col_ix in range(row_len):
|
||||
faces.append([
|
||||
point_map[(0, (col_ix-1+torus_connect_offset)%row_len)],
|
||||
point_map[(0, (col_ix+torus_connect_offset)%row_len)],
|
||||
point_map[(rows-1, col_ix%row_len)],
|
||||
point_map[(rows-1, (col_ix-1)%row_len)]
|
||||
])
|
||||
|
||||
return cls(points=point_list, faces=faces, convexity=convexity)
|
||||
|
||||
@classmethod
|
||||
def from_heightmap(cls, heights: List[List[float]], base: float = 0., convexity: int = 10):
|
||||
"""Construct a polyhedron from a 2D matrix of heights. If the height at [0,0] is Z, it maps
|
||||
to the point (0, 0, Z).
|
||||
|
||||
heights: The 2D matrix of heights
|
||||
base: The height at which the base will be - in the scale of heights (optional; default 0)
|
||||
convexity: see OpenSCAD
|
||||
"""
|
||||
rows = len(heights)
|
||||
row_len = len(heights[0])
|
||||
point_list = []
|
||||
point_map = {} # { (row_ix,col_ix) -> list_ix, ...
|
||||
bottom_point_map = {}
|
||||
for row_ix, row in enumerate(heights):
|
||||
for col_ix, height in enumerate(row):
|
||||
point = Point([row_ix, col_ix, height])
|
||||
bottom_point = Point([row_ix, col_ix, base])
|
||||
|
||||
point_map[(row_ix, col_ix)] = len(point_list)
|
||||
point_list.append(point)
|
||||
|
||||
bottom_point_map[(row_ix, col_ix)] = len(point_list)
|
||||
point_list.append(bottom_point)
|
||||
|
||||
faces = []
|
||||
|
||||
# Surface (top) faces
|
||||
# r 10 11
|
||||
# c
|
||||
# 10 1 2
|
||||
# 11 4 3
|
||||
for row_ix in range(1, rows):
|
||||
for col_ix in range(1, row_len):
|
||||
faces.append([
|
||||
point_map[(row_ix-1, col_ix-1)],
|
||||
point_map[(row_ix, col_ix-1)],
|
||||
point_map[(row_ix, col_ix)],
|
||||
point_map[(row_ix-1, col_ix)]
|
||||
])
|
||||
|
||||
# Bottom faces
|
||||
for row_ix in range(1, rows):
|
||||
for col_ix in range(1, row_len):
|
||||
faces.append([
|
||||
bottom_point_map[(row_ix-1, col_ix-1)], # 1
|
||||
bottom_point_map[(row_ix-1, col_ix)], # 4
|
||||
bottom_point_map[(row_ix, col_ix)], # 3
|
||||
bottom_point_map[(row_ix, col_ix-1)] # 2
|
||||
])
|
||||
|
||||
# Side faces
|
||||
for row_ix in range(1, rows):
|
||||
m = row_len - 1
|
||||
faces.append([
|
||||
point_map[(row_ix-1, m)],
|
||||
point_map[(row_ix, m)],
|
||||
bottom_point_map[(row_ix, m)],
|
||||
bottom_point_map[(row_ix-1, m)]
|
||||
])
|
||||
faces.append([
|
||||
point_map[(row_ix, 0)],
|
||||
point_map[(row_ix-1, 0)],
|
||||
bottom_point_map[(row_ix-1, 0)],
|
||||
bottom_point_map[(row_ix, 0)]
|
||||
])
|
||||
|
||||
for col_ix in range(1, row_len):
|
||||
m = rows - 1
|
||||
faces.append([
|
||||
point_map[(m, col_ix-1)],
|
||||
point_map[(m, col_ix)],
|
||||
bottom_point_map[(m, col_ix)],
|
||||
bottom_point_map[(m, col_ix-1)]
|
||||
])
|
||||
faces.append([
|
||||
point_map[(0, col_ix)],
|
||||
point_map[(0, col_ix-1)],
|
||||
bottom_point_map[(0, col_ix-1)],
|
||||
bottom_point_map[(0, col_ix)]
|
||||
])
|
||||
|
||||
return cls(points=point_list, faces=faces, convexity=convexity)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
faces_list = [f"[{','.join([str(x) for x in face])}]" for face in self.faces]
|
||||
return f"polyhedron(points=[{','.join([p.render() for p in self.points])}], faces=[{','.join(faces_list)}], convexity={self.convexity});"
|
||||
|
||||
def render_stl(self) -> str:
|
||||
"""Export the polyhedron as an STL file"""
|
||||
stl = []
|
||||
|
||||
def write_triangle(p1, p2, p3):
|
||||
normal = (p2 - p1).cross(p3 - p1)
|
||||
if normal.is_zero():
|
||||
# Degenerate triangle
|
||||
return
|
||||
normal = normal.norm()
|
||||
stl.append("facet normal " + normal.render_stl())
|
||||
stl.append("outer loop")
|
||||
for p in [p1, p2, p3]:
|
||||
stl.append("vertex " + p.render_stl())
|
||||
stl.append("endloop")
|
||||
stl.append("endfacet")
|
||||
|
||||
stl.append("solid oscpy")
|
||||
for face in self.faces:
|
||||
face = [self.points[i] for i in face]
|
||||
# stl.append(f"# FACE {len(face)} {','.join([p.render() for p in face])}")
|
||||
if len(face) < 3:
|
||||
raise Exception("Face has less than 3 points")
|
||||
elif len(face) == 3:
|
||||
write_triangle(face[0], face[1], face[2])
|
||||
elif len(face) == 4:
|
||||
# Decide which diagonal is best to break on
|
||||
d1 = face[0].sub(face[2]).length()
|
||||
d2 = face[1].sub(face[3]).length()
|
||||
if d1 < d2:
|
||||
write_triangle(face[0], face[1], face[2])
|
||||
write_triangle(face[0], face[2], face[3])
|
||||
else:
|
||||
write_triangle(face[0], face[1], face[3])
|
||||
write_triangle(face[1], face[2], face[3])
|
||||
else:
|
||||
# Add central point and split face in a star-shaped form
|
||||
# of course this won't always work on concave faces
|
||||
s = None
|
||||
for p in face:
|
||||
if s is None:
|
||||
s = p
|
||||
else:
|
||||
s += p
|
||||
s = s.scale(1 / len(face))
|
||||
for i in range(len(face)):
|
||||
i_next = i + 1
|
||||
if i_next > len(face) - 1:
|
||||
i_next = 0
|
||||
write_triangle(face[i], face[i_next], s)
|
||||
stl.append("endsolid oscpy")
|
||||
return "\n".join(stl)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Static methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.from_heightmap"><code class="name flex">
|
||||
<span>def <span class="ident">from_heightmap</span></span>(<span>heights: List[List[float]], base: float = 0.0, convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Construct a polyhedron from a 2D matrix of heights. If the height at [0,0] is Z, it maps
|
||||
to the point (0, 0, Z).</p>
|
||||
<p>heights: The 2D matrix of heights
|
||||
base: The height at which the base will be - in the scale of heights (optional; default 0)
|
||||
convexity: see OpenSCAD</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.torus"><code class="name flex">
|
||||
<span>def <span class="ident">torus</span></span>(<span>points: List[List[list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>]],<br>torus_connect_offset: int = 0,<br>convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Construct a torus-like polyhedron from a 2D array of points.
|
||||
Each row of points must be oriented clockwise when looking from the first row (loop) toward the next.
|
||||
The rows of points form loops.</p>
|
||||
<p>points: A 2D array of points
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.tube"><code class="name flex">
|
||||
<span>def <span class="ident">tube</span></span>(<span>points: List[List[list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>]],<br>make_torus: bool = False,<br>torus_connect_offset: int = 0,<br>convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Construct a tube-like polyhedron from a 2D array of points.
|
||||
Each row of points must be oriented clockwise when looking at the pipe at the start inwards.
|
||||
The rows of points form loops.</p>
|
||||
<p>points: A 2D array of points
|
||||
make_torus: bool, Whether to create a torus-like shape instead of a pipe with ends
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.render_stl"><code class="name flex">
|
||||
<span>def <span class="ident">render_stl</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Export the polyhedron as an STL file</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.polyhedron.Polyhedron.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.polyhedron.Polyhedron" href="#openscad_py.polyhedron.Polyhedron">Polyhedron</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.color" href="object_.html#openscad_py.polyhedron.Polyhedron.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.delta_offset" href="object_.html#openscad_py.polyhedron.Polyhedron.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.diff" href="object_.html#openscad_py.polyhedron.Polyhedron.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.extrude" href="object_.html#openscad_py.polyhedron.Polyhedron.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.from_heightmap" href="#openscad_py.polyhedron.Polyhedron.from_heightmap">from_heightmap</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.intersection" href="object_.html#openscad_py.polyhedron.Polyhedron.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.move" href="object_.html#openscad_py.polyhedron.Polyhedron.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.radial_offset" href="object_.html#openscad_py.polyhedron.Polyhedron.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.render" href="#openscad_py.polyhedron.Polyhedron.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.render_stl" href="#openscad_py.polyhedron.Polyhedron.render_stl">render_stl</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.rotate" href="object_.html#openscad_py.polyhedron.Polyhedron.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.rotate_extrude" href="object_.html#openscad_py.polyhedron.Polyhedron.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.scale" href="object_.html#openscad_py.polyhedron.Polyhedron.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.torus" href="#openscad_py.polyhedron.Polyhedron.torus">torus</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.translate" href="object_.html#openscad_py.polyhedron.Polyhedron.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.tube" href="#openscad_py.polyhedron.Polyhedron.tube">tube</a></code></li>
|
||||
<li><code><a title="openscad_py.polyhedron.Polyhedron.union" href="object_.html#openscad_py.polyhedron.Polyhedron.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.radial_offset API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.radial_offset</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset"><code class="flex name class">
|
||||
<span>class <span class="ident">RadialOffset</span></span>
|
||||
<span>(</span><span>r,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A new 2d interior or exterior outline from an existing outline</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class RadialOffset(Object):
|
||||
"""A new 2d interior or exterior outline from an existing outline
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset
|
||||
"""
|
||||
|
||||
def __init__(self, r, child: Object):
|
||||
self.r = r
|
||||
self.child = child
|
||||
# $fa, $fs, and $fn
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"offset(r={self.r}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.radial_offset.RadialOffset.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.radial_offset.RadialOffset" href="#openscad_py.radial_offset.RadialOffset">RadialOffset</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.color" href="object_.html#openscad_py.radial_offset.RadialOffset.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.delta_offset" href="object_.html#openscad_py.radial_offset.RadialOffset.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.diff" href="object_.html#openscad_py.radial_offset.RadialOffset.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.extrude" href="object_.html#openscad_py.radial_offset.RadialOffset.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.intersection" href="object_.html#openscad_py.radial_offset.RadialOffset.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.move" href="object_.html#openscad_py.radial_offset.RadialOffset.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.radial_offset" href="object_.html#openscad_py.radial_offset.RadialOffset.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.render" href="#openscad_py.radial_offset.RadialOffset.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.rotate" href="object_.html#openscad_py.radial_offset.RadialOffset.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.rotate_extrude" href="object_.html#openscad_py.radial_offset.RadialOffset.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.scale" href="object_.html#openscad_py.radial_offset.RadialOffset.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.translate" href="object_.html#openscad_py.radial_offset.RadialOffset.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.radial_offset.RadialOffset.union" href="object_.html#openscad_py.radial_offset.RadialOffset.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,256 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.rotate API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.rotate</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.rotate.Rotate"><code class="flex name class">
|
||||
<span>class <span class="ident">Rotate</span></span>
|
||||
<span>(</span><span>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a rotation transformation applied to an object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Rotate(Object):
|
||||
"""Represents a rotation transformation applied to an object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate
|
||||
"""
|
||||
|
||||
def __init__(self, a, v: TUnion[list, Point], child: Object):
|
||||
self.a = a
|
||||
self.v = Point.c(v)
|
||||
self.child = child
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"rotate(a={self.a}, v={self.v.render()}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.rotate.Rotate.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate.Rotate.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.rotate.Rotate" href="#openscad_py.rotate.Rotate">Rotate</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.rotate.Rotate.color" href="object_.html#openscad_py.rotate.Rotate.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.delta_offset" href="object_.html#openscad_py.rotate.Rotate.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.diff" href="object_.html#openscad_py.rotate.Rotate.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.extrude" href="object_.html#openscad_py.rotate.Rotate.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.intersection" href="object_.html#openscad_py.rotate.Rotate.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.move" href="object_.html#openscad_py.rotate.Rotate.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.radial_offset" href="object_.html#openscad_py.rotate.Rotate.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.render" href="#openscad_py.rotate.Rotate.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.rotate" href="object_.html#openscad_py.rotate.Rotate.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.rotate_extrude" href="object_.html#openscad_py.rotate.Rotate.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.scale" href="object_.html#openscad_py.rotate.Rotate.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.translate" href="object_.html#openscad_py.rotate.Rotate.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate.Rotate.union" href="object_.html#openscad_py.rotate.Rotate.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,260 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.rotate_extrude API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.rotate_extrude</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude"><code class="flex name class">
|
||||
<span>class <span class="ident">RotateExtrude</span></span>
|
||||
<span>(</span><span>angle,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>,<br>convexity: int = 10)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a rotational extrusion of a (2D) object.
|
||||
For all points, x>=0 must hold.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class RotateExtrude(Object):
|
||||
"""Represents a rotational extrusion of a (2D) object.
|
||||
For all points, x>=0 must hold.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion
|
||||
"""
|
||||
|
||||
def __init__(self, angle, child: Object, convexity: int = 10):
|
||||
self.angle = angle
|
||||
self.child = child
|
||||
self.convexity = convexity
|
||||
# $fa, $fs, $fn
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"rotate_extrude(angle={self.angle}, convexity={self.convexity}) {{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.rotate_extrude.RotateExtrude.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.rotate_extrude.RotateExtrude" href="#openscad_py.rotate_extrude.RotateExtrude">RotateExtrude</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.color" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.delta_offset" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.diff" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.extrude" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.intersection" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.move" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.radial_offset" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.render" href="#openscad_py.rotate_extrude.RotateExtrude.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.rotate" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.rotate_extrude" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.scale" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.translate" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.rotate_extrude.RotateExtrude.union" href="object_.html#openscad_py.rotate_extrude.RotateExtrude.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.scale API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.scale</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.scale.Scale"><code class="flex name class">
|
||||
<span>class <span class="ident">Scale</span></span>
|
||||
<span>(</span><span>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float | int,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a scale transformation applied to an object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Scale(Object):
|
||||
"""Represents a scale transformation applied to an object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#scale
|
||||
"""
|
||||
|
||||
def __init__(self, v: TUnion[list, Point, float, int], child: Object):
|
||||
if isinstance(v, float) or isinstance(v, int):
|
||||
v = [v, v, v]
|
||||
self.v = Point.c(v)
|
||||
self.child = child
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"scale(v={self.v.render()}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.scale.Scale.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.scale.Scale.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.scale.Scale" href="#openscad_py.scale.Scale">Scale</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.scale.Scale.color" href="object_.html#openscad_py.scale.Scale.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.delta_offset" href="object_.html#openscad_py.scale.Scale.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.diff" href="object_.html#openscad_py.scale.Scale.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.extrude" href="object_.html#openscad_py.scale.Scale.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.intersection" href="object_.html#openscad_py.scale.Scale.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.move" href="object_.html#openscad_py.scale.Scale.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.radial_offset" href="object_.html#openscad_py.scale.Scale.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.render" href="#openscad_py.scale.Scale.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.rotate" href="object_.html#openscad_py.scale.Scale.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.rotate_extrude" href="object_.html#openscad_py.scale.Scale.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.scale" href="object_.html#openscad_py.scale.Scale.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.translate" href="object_.html#openscad_py.scale.Scale.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.scale.Scale.union" href="object_.html#openscad_py.scale.Scale.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,258 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.sphere API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.sphere</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.sphere.Sphere"><code class="flex name class">
|
||||
<span>class <span class="ident">Sphere</span></span>
|
||||
<span>(</span><span>r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>A 3D primitive, sphere.
|
||||
Creates a sphere at the origin of the coordinate system.</p>
|
||||
<p>See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#sphere">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#sphere</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Sphere(Object):
|
||||
"""A 3D primitive, sphere.
|
||||
Creates a sphere at the origin of the coordinate system.
|
||||
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#sphere
|
||||
"""
|
||||
|
||||
def __init__(self, r):
|
||||
self.r = r
|
||||
# $fa, $fs, $fn
|
||||
|
||||
def render(self):
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"sphere(r={self.r});"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.sphere.Sphere.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.sphere.Sphere.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.sphere.Sphere" href="#openscad_py.sphere.Sphere">Sphere</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.sphere.Sphere.color" href="object_.html#openscad_py.sphere.Sphere.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.delta_offset" href="object_.html#openscad_py.sphere.Sphere.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.diff" href="object_.html#openscad_py.sphere.Sphere.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.extrude" href="object_.html#openscad_py.sphere.Sphere.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.intersection" href="object_.html#openscad_py.sphere.Sphere.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.move" href="object_.html#openscad_py.sphere.Sphere.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.radial_offset" href="object_.html#openscad_py.sphere.Sphere.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.render" href="#openscad_py.sphere.Sphere.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.rotate" href="object_.html#openscad_py.sphere.Sphere.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.rotate_extrude" href="object_.html#openscad_py.sphere.Sphere.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.scale" href="object_.html#openscad_py.sphere.Sphere.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.translate" href="object_.html#openscad_py.sphere.Sphere.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.sphere.Sphere.union" href="object_.html#openscad_py.sphere.Sphere.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,255 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.translate API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.translate</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.translate.Translate"><code class="flex name class">
|
||||
<span>class <span class="ident">Translate</span></span>
|
||||
<span>(</span><span>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>,<br>child: <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a translation transformation applied to an object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Translate(Object):
|
||||
"""Represents a translation transformation applied to an object.
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate
|
||||
"""
|
||||
|
||||
def __init__(self, v: TUnion[list, Point], child: Object):
|
||||
self.v = Point.c(v)
|
||||
self.child = child
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"translate(v={self.v.render()}){{\n{self.child.render()}\n}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.translate.Translate.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.translate.Translate.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.translate.Translate" href="#openscad_py.translate.Translate">Translate</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.translate.Translate.color" href="object_.html#openscad_py.translate.Translate.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.delta_offset" href="object_.html#openscad_py.translate.Translate.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.diff" href="object_.html#openscad_py.translate.Translate.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.extrude" href="object_.html#openscad_py.translate.Translate.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.intersection" href="object_.html#openscad_py.translate.Translate.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.move" href="object_.html#openscad_py.translate.Translate.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.radial_offset" href="object_.html#openscad_py.translate.Translate.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.render" href="#openscad_py.translate.Translate.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.rotate" href="object_.html#openscad_py.translate.Translate.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.rotate_extrude" href="object_.html#openscad_py.translate.Translate.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.scale" href="object_.html#openscad_py.translate.Translate.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.translate" href="object_.html#openscad_py.translate.Translate.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.translate.Translate.union" href="object_.html#openscad_py.translate.Translate.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.3">
|
||||
<title>openscad_py.union API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin:1em 0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>openscad_py.union</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="openscad_py.union.Union"><code class="flex name class">
|
||||
<span>class <span class="ident">Union</span></span>
|
||||
<span>(</span><span>child: list | <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Represents a union applied to an object (usually a collection of objects).
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union</a></p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Union(Object):
|
||||
"""Represents a union applied to an object (usually a collection of objects).
|
||||
See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union
|
||||
"""
|
||||
|
||||
def __init__(self, child: TUnion[Object, list]):
|
||||
self.child = Collection.c(child)
|
||||
|
||||
def render(self) -> str:
|
||||
"""Render the object into OpenSCAD code"""
|
||||
return f"union(){{ {self.child.render()} }}"
|
||||
|
||||
def union(self, objects: TUnion[list, Object]) -> Object:
|
||||
return self.__class__(self.child._add(objects))</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="openscad_py.union.Union.color"><code class="name flex">
|
||||
<span>def <span class="ident">color</span></span>(<span>self, r, g, b, a=1.0) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.color" href="object_.html#openscad_py.object_.Object.color">color</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a color and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.delta_offset"><code class="name flex">
|
||||
<span>def <span class="ident">delta_offset</span></span>(<span>self, delta, chamfer=False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.delta_offset" href="object_.html#openscad_py.object_.Object.delta_offset">delta_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.diff"><code class="name flex">
|
||||
<span>def <span class="ident">diff</span></span>(<span>self,<br>tool: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.diff" href="object_.html#openscad_py.object_.Object.diff">diff</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Remove from the object using a difference operator, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.extrude"><code class="name flex">
|
||||
<span>def <span class="ident">extrude</span></span>(<span>self, height, convexity=10, center: bool = False) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.extrude" href="object_.html#openscad_py.object_.Object.extrude">extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a linear extrusion and return a new object.
|
||||
If <code>center</code> is false, the linear extrusion Z range is from 0 to height;
|
||||
if it is true, the range is …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.intersection"><code class="name flex">
|
||||
<span>def <span class="ident">intersection</span></span>(<span>self,<br>objects: list | ForwardRef('<a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>')) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.intersection" href="object_.html#openscad_py.object_.Object.intersection">intersection</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Get the intersection of self and an object of list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.move"><code class="name flex">
|
||||
<span>def <span class="ident">move</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.move" href="object_.html#openscad_py.object_.Object.move">move</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object. Synonym of <code>translate()</code></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.radial_offset"><code class="name flex">
|
||||
<span>def <span class="ident">radial_offset</span></span>(<span>self, r)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.radial_offset" href="object_.html#openscad_py.object_.Object.radial_offset">radial_offset</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Return a new 2D interior or exterior outline from an existing outline.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.render"><code class="name flex">
|
||||
<span>def <span class="ident">render</span></span>(<span>self) ‑> str</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.render" href="object_.html#openscad_py.object_.Object.render">render</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Render the object into OpenSCAD code</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.rotate"><code class="name flex">
|
||||
<span>def <span class="ident">rotate</span></span>(<span>self,<br>a,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate" href="object_.html#openscad_py.object_.Object.rotate">rotate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#rotate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.rotate_extrude"><code class="name flex">
|
||||
<span>def <span class="ident">rotate_extrude</span></span>(<span>self, angle, convexity=10) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.rotate_extrude" href="object_.html#openscad_py.object_.Object.rotate_extrude">rotate_extrude</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a rotational extrusion and return a new object. For all points x >= 0 must be true.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.scale"><code class="name flex">
|
||||
<span>def <span class="ident">scale</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a> | float) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.scale" href="object_.html#openscad_py.object_.Object.scale">scale</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply scaling and return a new object. Accepts a vector (a Point object or a list of floats)
|
||||
or a single float for uniform scaling.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.translate"><code class="name flex">
|
||||
<span>def <span class="ident">translate</span></span>(<span>self,<br>v: list | <a title="openscad_py.point.Point" href="point.html#openscad_py.point.Point">Point</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.translate" href="object_.html#openscad_py.object_.Object.translate">translate</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Apply a translation and return a new object.
|
||||
See <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate">https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#translate</a></p></div>
|
||||
</dd>
|
||||
<dt id="openscad_py.union.Union.union"><code class="name flex">
|
||||
<span>def <span class="ident">union</span></span>(<span>self,<br>objects: list | <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a>) ‑> <a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<p class="inheritance">
|
||||
<em>Inherited from:</em>
|
||||
<code><a title="openscad_py.object_.Object" href="object_.html#openscad_py.object_.Object">Object</a></code>.<code><a title="openscad_py.object_.Object.union" href="object_.html#openscad_py.object_.Object.union">union</a></code>
|
||||
</p>
|
||||
<div class="desc inherited"><p>Form the union of self and an object or list of objects, and return a new object.
|
||||
See …</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="openscad_py" href="index.html">openscad_py</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="openscad_py.union.Union" href="#openscad_py.union.Union">Union</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="openscad_py.union.Union.color" href="object_.html#openscad_py.union.Union.color">color</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.delta_offset" href="object_.html#openscad_py.union.Union.delta_offset">delta_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.diff" href="object_.html#openscad_py.union.Union.diff">diff</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.extrude" href="object_.html#openscad_py.union.Union.extrude">extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.intersection" href="object_.html#openscad_py.union.Union.intersection">intersection</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.move" href="object_.html#openscad_py.union.Union.move">move</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.radial_offset" href="object_.html#openscad_py.union.Union.radial_offset">radial_offset</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.render" href="#openscad_py.union.Union.render">render</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.rotate" href="object_.html#openscad_py.union.Union.rotate">rotate</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.rotate_extrude" href="object_.html#openscad_py.union.Union.rotate_extrude">rotate_extrude</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.scale" href="object_.html#openscad_py.union.Union.scale">scale</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.translate" href="object_.html#openscad_py.union.Union.translate">translate</a></code></li>
|
||||
<li><code><a title="openscad_py.union.Union.union" href="#openscad_py.union.Union.union">union</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.3</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -13,11 +13,12 @@ class PathTube(Object):
|
|||
|
||||
def __init__(self, points: List[TUnion[list, Point]], radius: TUnion[float, list], fn: int, make_torus: bool = False, convexity: int = 10):
|
||||
"""
|
||||
points: The list of points
|
||||
radius: A float or a list of floats for each point
|
||||
fn: int, The number of sides
|
||||
make_torus: bool, Whether to make a torus instead of a pipe with ends. Warning: the last segment may be twisted.
|
||||
convexity: see openscad
|
||||
Arguments:
|
||||
- points: The list of points
|
||||
- radius: A float or a list of floats for each point
|
||||
- fn: int, The number of sides
|
||||
- make_torus: bool, Whether to make a torus instead of a pipe with ends. Warning: the last segment may be twisted.
|
||||
- convexity: see openscad
|
||||
"""
|
||||
self.points = [Point.c(p) for p in points]
|
||||
self.radii = radius if isinstance(radius, list) else [radius for p in points]
|
||||
|
|
|
@ -27,9 +27,10 @@ class Polyhedron(Object):
|
|||
Each row of points must be oriented clockwise when looking from the first row (loop) toward the next.
|
||||
The rows of points form loops.
|
||||
|
||||
points: A 2D array of points
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD
|
||||
Arguments:
|
||||
- points: A 2D array of points
|
||||
- torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
- convexity: int, see OpensCAD
|
||||
"""
|
||||
return cls.tube(points=points, convexity=convexity, make_torus=True, torus_connect_offset=torus_connect_offset)
|
||||
|
||||
|
@ -38,11 +39,12 @@ class Polyhedron(Object):
|
|||
"""Construct a tube-like polyhedron from a 2D array of points.
|
||||
Each row of points must be oriented clockwise when looking at the pipe at the start inwards.
|
||||
The rows of points form loops.
|
||||
|
||||
points: A 2D array of points
|
||||
make_torus: bool, Whether to create a torus-like shape instead of a pipe with ends
|
||||
torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
convexity: int, see OpensCAD
|
||||
|
||||
Arguments:
|
||||
- points: A 2D array of points
|
||||
- make_torus: bool, Whether to create a torus-like shape instead of a pipe with ends
|
||||
- torus_connect_offset: int, Whether to shift which points are connected in a torus in the last segment
|
||||
- convexity: int, see OpensCAD
|
||||
"""
|
||||
rows = len(points)
|
||||
row_len = len(points[0])
|
||||
|
@ -96,9 +98,10 @@ class Polyhedron(Object):
|
|||
"""Construct a polyhedron from a 2D matrix of heights. If the height at [0,0] is Z, it maps
|
||||
to the point (0, 0, Z).
|
||||
|
||||
heights: The 2D matrix of heights
|
||||
base: The height at which the base will be - in the scale of heights (optional; default 0)
|
||||
convexity: see OpenSCAD
|
||||
Arguments:
|
||||
- heights: The 2D matrix of heights
|
||||
- base: The height at which the base will be - in the scale of heights (optional; default 0)
|
||||
- convexity: see OpenSCAD
|
||||
"""
|
||||
rows = len(heights)
|
||||
row_len = len(heights[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue