Skip to content

Commit

Permalink
GPLv2 - GPLv3, format header comments
Browse files Browse the repository at this point in the history
Per discussion in Matrix Dev channel, GPLv2 license has been updated to GPLv3, and is now included in the base level of the addon, to ensure everyone will receive a copy, regardless of how they download or install.

Formatted header comments for consistency.
Now every file follows this format:

"""BlenderCAM 'filename.py' © 20xx Author Name (if available)

Brief summary of what is in the file (functions, classes) and what they do.
Original developer comments. (if available)
"""
  • Loading branch information
SpectralVectors authored Apr 15, 2024
1 parent 6ec5bed commit fb3005c
Show file tree
Hide file tree
Showing 73 changed files with 517 additions and 651 deletions.
26 changes: 5 additions & 21 deletions scripts/addons/cam/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# blender CAM __init__.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK ****
"""BlenderCAM '__init__.py' © 2012 Vilem Novak
Import Modules, bl_info, Register and Unregister Classes
"""

# Python Standard Library
import subprocess
Expand Down Expand Up @@ -199,7 +183,7 @@
bl_info = {
"name": "BlenderCAM - G-code Generation Tools",
"author": "Vilem Novak & Contributors",
"version":(1,0,19),
"version": (1, 0, 19),
"blender": (3, 6, 0),
"location": "Properties > render",
"description": "Generate Machining Paths for CNC",
Expand Down
6 changes: 6 additions & 0 deletions scripts/addons/cam/async_op.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""BlenderCAM 'async_op.py'
Functions and Classes to allow asynchronous updates.
Used to report progress during path calculation.
"""

import sys
import types

Expand Down
5 changes: 5 additions & 0 deletions scripts/addons/cam/autoupdate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""BlenderCAM 'autoupdate.py'
Classes to check for, download and install BlenderCAM updates.
"""

import calendar
from datetime import date
import io
Expand Down
6 changes: 6 additions & 0 deletions scripts/addons/cam/basrelief.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""BlenderCAM 'basrelief.py'
Module to allow the creation of reliefs from Images or View Layers.
(https://en.wikipedia.org/wiki/Relief#Bas-relief_or_low_relief)
"""

from math import (
ceil,
floor,
Expand Down
27 changes: 6 additions & 21 deletions scripts/addons/cam/bridges.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
# blender CAM utils.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
# here is the bridges functionality of Blender CAM. The functions here are called with operators defined from ops.py.
"""BlenderCAM 'bridges.py' © 2012 Vilem Novak
Functions to add Bridges / Tabs to meshes or curves.
Called with Operators defined in 'ops.py'
"""

from math import (
hypot,
pi,
Expand Down
24 changes: 4 additions & 20 deletions scripts/addons/cam/cam_chunk.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# blender CAM chunk.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
"""BlenderCAM 'chunk.py' © 2012 Vilem Novak
Classes and Functions to build, store and optimize CAM path chunks.
"""

from math import (
ceil,
Expand Down
5 changes: 5 additions & 0 deletions scripts/addons/cam/cam_operation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""BlenderCAM 'cam_operation.py'
All properties of a single CAM Operation.
"""

from math import pi

import numpy
Expand Down
5 changes: 5 additions & 0 deletions scripts/addons/cam/chain.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""BlenderCAM 'chain.py'
All properties of a CAM Chain (a series of Operations), and the Chain's Operation reference.
"""

from bpy.props import (
BoolProperty,
CollectionProperty,
Expand Down
27 changes: 6 additions & 21 deletions scripts/addons/cam/collision.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# blender CAM collision.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
"""BlenderCAM 'collision.py' © 2012 Vilem Novak
Functions for Bullet and Cutter collision checks.
"""

from math import (
cos,
pi,
Expand Down Expand Up @@ -318,7 +303,7 @@ def cleanupBulletCollision(o):


def getSampleBullet(cutter, x, y, radius, startz, endz):
"""collision test for 3 axis milling. Is simplified compared to the full 3d test"""
"""Collision Test for 3 Axis Milling. Is Simplified Compared to the Full 3D Test"""
scene = bpy.context.scene
pos = scene.rigidbody_world.convex_sweep_test(cutter, (x * BULLET_SCALE, y * BULLET_SCALE, startz * BULLET_SCALE),
(x * BULLET_SCALE, y * BULLET_SCALE, endz * BULLET_SCALE))
Expand Down
11 changes: 7 additions & 4 deletions scripts/addons/cam/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""BlenderCAM 'constants.py'
# Package to store all constants of BlenderCAM
Package to store all constants of BlenderCAM.
"""

# PRECISION is used in most operations
PRECISION = 5
Expand All @@ -10,8 +12,9 @@

G64_INCOMPATIBLE_MACHINES = ['GRBL']

# Upscale factor for higher precision from Bullet library - (Rigidbody Collision World)
BULLET_SCALE = 10000
# this is a constant for scaling the rigidbody collision world for higher precision from bullet library

# Cutter object must be present in the scene, so we need to put it aside for sweep collisions,
# otherwise it collides with itself.
CUTTER_OFFSET = (-5 * BULLET_SCALE, -5 * BULLET_SCALE, -5 * BULLET_SCALE)
# the cutter object has to be present in the scene , so we need to put it aside for sweep collisions,
# otherwise it collides itself.
25 changes: 5 additions & 20 deletions scripts/addons/cam/curvecamcreate.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# blender CAM ops.py (c) 2022 Alain Pelletier
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
"""BlenderCAM 'curvecamcreate.py' © 2021, 2022 Alain Pelletier
Operators to create a number of predefined curve objects.
"""

from math import (
degrees,
hypot,
Expand Down
25 changes: 5 additions & 20 deletions scripts/addons/cam/curvecamequation.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# blender CAM curvecamequation.py (c) 2021 Alain Pelletier
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
"""BlenderCAM 'curvecamequation.py' © 2021, 2022 Alain Pelletier
Operators to create a number of geometric shapes with curves.
"""

from math import pi

from Equation import Expression
Expand Down
27 changes: 5 additions & 22 deletions scripts/addons/cam/curvecamtools.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# blender CAM ops.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****

# blender operators definitions are in this file. They mostly call the functions from utils.py
"""BlenderCAM 'curvecamtools.py' © 2012 Vilem Novak, 2021 Alain Pelletier
Operators that perform various functions on existing curves.
"""

from math import (
pi,
tan
Expand Down
5 changes: 5 additions & 0 deletions scripts/addons/cam/engine.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""BlenderCAM 'engine.py'
Engine definition, options and panels.
"""

from bl_ui.properties_material import (
EEVEE_MATERIAL_PT_context_material,
EEVEE_MATERIAL_PT_settings,
Expand Down
6 changes: 6 additions & 0 deletions scripts/addons/cam/exception.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
"""BlenderCAM 'exception.py'
Generic CAM Exception class.
"""


class CamException(Exception):
pass
27 changes: 7 additions & 20 deletions scripts/addons/cam/gcodeimportparser.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#!/usr/bin/env python
# https://github.com/jonathanwin/yagv with no licence
# code modified from YAGV -yet another gcode viewer
# will assume release GNU release
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
"""BlenderCAM 'gcodeimportparser.py'
Code modified from YAGV (Yet Another G-code Viewer) - https://github.com/jonathanwin/yagv
No license terms found in YAGV repo, will assume GNU release
"""

import math

import numpy as np
Expand All @@ -27,7 +14,7 @@


def import_gcode(context, filepath):
print("running read_some_data...")
print("Running read_some_data...")

scene = context.scene
mytool = scene.cam_import_gcode
Expand Down
28 changes: 6 additions & 22 deletions scripts/addons/cam/gcodepath.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# blender CAM gcodepath.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****

# here is the Gcode generaton
"""BlenderCAM 'gcodepath.py' © 2012 Vilem Novak
Generate and Export G-Code based on scene, machine, chain, operation and path settings.
"""

# G-code Generaton
from math import (
ceil,
floor,
Expand Down
Loading

0 comments on commit fb3005c

Please sign in to comment.