Constraint-based geometry sketcher for blender

Overview

Geometry Sketcher

Constraint-based sketcher addon for Blender that allows to create precise 2d shapes by defining a set of geometric constraints like tangent, distance, angle, equal and more. Sketches stay editable and support a fully non-destructive workflow.

Minimum version: Blender 2.92

Discussion and feedback: Discord

⚠️ Experimental addon: This is still work in progress, don't use it on production files without a backup.

Addon installation

  • Download the ZIP archive from github (do not unpack it after downloading)
  • Open Blender and go to: Edit > Preferences > Add-ons > Press "Install..." button
  • Browse to the location of the ZIP and select it, then press "Install Add-on"
  • Enable the addon by pressing the checkbox

Dependency installation

Geometry sketcher heavily depends on the solvespace python module and won't be fully funtional without it.

  • Inside the addon's preferences check the "Solver Module" tab to see if the module is already available
  • Either press "Install from PyPi"
  • Or download the appropriate *.whl file here and press "Install from local File"
Issues
  • construction line problem (?)

    construction line problem (?)

    1. draw rectangle, make it 4 meters on one side and 7 on the other.
    2. draw a diagonal line top right to bottom left, and make it a construction line
    3. click on the midpoint and the line and make the line a construction line.
    4. Resize the box to 20mm on one side and 40mm on the other. The construction line won't reach all the way to the bottom left.
    5. Delete the construction line and draw a new line top right corner to bottom left.
    6. Make it a construction line. The new line doesn't go all the way to the bottom left. Repeated attempts will produce the same result. Expected the original construction line to resize with the rectangle. Otherwise, expected the new construction line to maintain length when converted from a regular line. Using Blender 3.1.0 and latest version of sketcher (downloaded april 23) cosntructionLine
    bug 
    opened by pgrove604 10
  • Solidifying a sketch - Jagged result

    Solidifying a sketch - Jagged result

    I might be missing something, but is there a way to correct the 'jagged' result of solidify modifier? https://user-images.githubusercontent.com/507113/134035213-0180d4e9-b9dc-470f-8590-b8a25f85f41b.mp4

    opened by theoryshaw 10
  • Display shortcut hints for operators

    Display shortcut hints for operators

    This is proposal for #95

    • Extract out all the operators' names into a separate module to be reused without introducing cycle dependencies. Also put all the names in one place
    • Original thought was to have each operator defines its own keymap (makes more sense in term single responsibility) but due to the nature of key mapping where management/cross reference are more important, move them to a common place keymaps.py to be shared across.

    Multiple shortcuts: image

    Single shortcut: image

    opened by BaoNTGH 9
  • Line width not working on mac

    Line width not working on mac

    Description It may be a mac only thing, or resolution dependant- retina 13,3-inch (2560 × 1600)- the outer lines for sketching are too thin to use or select. It's an issue from the start- really hard to activate a plane when creating sketch (basically pixel thin..should it also be selectable from the "face" of the plane, not only the edge?), hard to select sides etc to add constraints.

    To Reproduce Steps to reproduce the behavior:

    1. Using the add-on on Macbook air M1

    Expected behavior To select the planes and sketche's edges without a hassle.

    System Information:

    • OS: macOS Monterey 12.3.1
    • Blender Version: 12.3.1
    • Addon Version: 0.20.0
    thin line blender bug gpu 
    opened by mervenca 9
  • add margin for Distance dimension text (solves Bug 145) - comments addressed

    add margin for Distance dimension text (solves Bug 145) - comments addressed

    WIP. Distance constraint looks OK. Angle and Diameter not implemented yet.

    https://user-images.githubusercontent.com/10360161/173745629-c30901cc-6c7c-482a-b42a-945c8136047c.mp4

    opened by exegetor 8
  • Support entity naming

    Support entity naming

    • By default, name will be generated by combining type and index.
    • Naming could be done through entity's context menu and also in entity browser
    • In entity browser, selector had been changed to the radio button in first column
    • name is introduced as StringProperty on SlvsGenericEntity as a wrapper of name property to provide default name value for entities saved by previous CAD Sketch plugin where name were not populated

    This is to address issue #53

    Change name in context menu image

    Change name in entity browser image

    Selection mode image

    opened by BaoNTGH 8
  • Interactive dimensions

    Interactive dimensions

    Related to #1

    would be nice to quickly change the dimension on segments as well...

    Perhaps, being able to 'move' the dimension to indicate which segment you'd like to measure off of.

    image

    image

    opened by theoryshaw 8
  • base the amount of dimension-line overshoot on the arrow size

    base the amount of dimension-line overshoot on the arrow size

    An overshoot is calculted for the extender lines for dimensions. The code is in gizmos.py, and around line 280 and 370 we find: overshoot = math.copysign(0.04, offset) and overshoot = math.copysign(0.04, radius)

    I found this overshoot value way out of proportion on a small part (<10mm). I've played around at different scales and found that

        overshoot = math.copysign(GIZMO_ARROW_SCALE * 0.02, offset)
    

    and overshoot = math.copysign(GIZMO_ARROW_SCALE * 0.02, radius)

    provides a pleasing appearance.

    Cheers, and great work on this! I haven't been so excited for an add-on since dynamic paint!

    opened by exegetor 7
  • [BUG] Angle constraint causing jumping when inverting constraint

    [BUG] Angle constraint causing jumping when inverting constraint

    Motivation / Existing Problem Let's say we are constraining the external angle to 45 degrees image

    When inverting the constraint to the inside. Those 45 degrees are no longer applicable image

    Instead, 90 degrees should be added to get 135 degrees and retain the same angle image

    bug 
    opened by ZanQdo 5
  • Incorrect highlighting of constraints [BUG]

    Incorrect highlighting of constraints [BUG]

    Description

    Mouse over highlighting seems to have problems in my system

    Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.59

    Here is a video demonstration of the problem where highlighting is wrong (notice the position of the mouse cursor and which constraint gets highlighted)

    https://user-images.githubusercontent.com/999476/166588333-9455a2fc-8932-428c-ae09-21a6854b89e2.mp4

    Addon Version

    0.22.2

    Blender Version

    3.3.0

    What platform are you running on?

    Windows

    Test file

    Distance.zip

    bug 
    opened by ZanQdo 5
  • [REQUEST] Option to delete a sketch by right clicking on the Sketch name in the N-panel

    [REQUEST] Option to delete a sketch by right clicking on the Sketch name in the N-panel

    Motivation / Existing Problem Currently, there seems to be no way to delete a sketch if it is not converted to a Mesh or Bezier Curve.

    Description To solve this problem, I propose to add a right click option in the N-panel to remove a sketch.

    Alternative Solutions Alternatively, hitting the delete button in the Sketches list should also delete a sketch.

    Workaround Convert the sketch to a mesh or bezier curve, select the mesh or curve and delete it. This also deletes the sketch. But this cannot be used reliably on open sketches (e.g. two crossing lines that are fully constrained).

    feature request 
    opened by Intuos5 4
  • WIP (one bug known) add circle-line and circle-point distance constraint

    WIP (one bug known) add circle-line and circle-point distance constraint

    i could not find a native py-slvs function for this constraint, so i faked it with an invisible construction line from the circle's centerpoint to the target and a point on the circle and a point on the target line (if applicable).

    Constraints are applied to tie it all together.

    The generic constraint now has lists for temporary, subordinate entities and constraints. They will be deleted when the primary constraint is deleted.

    HOWEVER, THERE IS STILL ABUG that leaves one subordinate constraint alive after its parent constraint is deleted. Anybody who spots the bug wins a gold star!

    opened by exegetor 1
  • VSCodium/VSCode: Remote debugger

    VSCodium/VSCode: Remote debugger

    Adds config files for Codium, / VS Code to

    • start Blender with the CADSketcher add on
    • Create a remote debug session in Blender
    • Connect to said remote debugger

    Introduces optional dependency to colorama for coloring stdout if it's on a terminal

    I will make a short write-up of the steps to set the dev env up for linux (requires to add a symlink of the CAD_Sketcher repo to the Blender add-on folder)

    opened by amrsoll 1
  • Minor refactors

    Minor refactors

    Some refactoring to make the code more "python'esque" and hopefully more readable.

    • Function docstrings
    • Move def function(self, ... ) inside the appropriate classes
    • Break down the data reading from the icons
    • Remove some unused functions / unnecessary lines
    • move most imports to the start of the file
    • A little bit of function typing
    • Remove global function tag_update -> Classfunction. Less confusing because of blender function with same name

    Note: I assumed that tag_update does not refer to the bpy tag_update function. Here I make an explicit reference to SlvsGenericEntity.tag_update()

    I have done minor testing to see if I didn't break anything major

    N.B. I would recommend using a develop branch for people to create PRs against :) just for sanity check before commiting multiple PRs into master

    opened by amrsoll 0
  • Allow setting properties/attributes on converted elements

    Allow setting properties/attributes on converted elements

    When convertion happens already converted geometry gets overwritten, this can lead to a loss of data when the user manually modifies anything in a destructive manner on the resulted object data and reruns the conversion. #104 is an example of this limitation.

    To allow changing properties and attributes there needs to be some way to set these values without them getting overwritten.

    The attributes branch tries to solve that by implementing a system that writes addon defined attributes whenever the conversion happens.

    Note: Conversion always involves a bezier curve which don't yet support geometry attributes, therefor attributes are currently limited to have per object/object data values

    Design:

    • Adds a CustomAttribute property group which stores the name, type and domain of the attribute definition
    • Attribute definitions are stored per sketch
    • Attribute values are stored per entity in an id property e.g. entity["attribute_values"] = {"some_integer": 12}
    • Values can be set on sketches, this acts as a default if no value is set on an entity Conversion :
    • Attributes of domain type "OBJECT" will try to set the value on the converted object and object data
    • Attributes of other domain types will set the property with the matching name on the mesh elements or set an geometry attribue with the same settings

    Alternatives: Another approach would be to try to reuse existing geometry when converting.

    opened by hlorus 0
Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python

geojson-area Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python. Installation $ pip install area U

Alireza 78 Apr 27, 2022
Wraps GEOS geometry functions in numpy ufuncs.

PyGEOS PyGEOS is a C/Python library with vectorized geometry functions. The geometry operations are done in the open-source geometry library GEOS. PyG

null 330 Jun 11, 2022
WIP: extracting Geometry utilities from datacube-core

odc.geo This is still work in progress. This repository contains geometry related code extracted from Open Datacube. For details and motivation see OD

Open Data Cube 22 Jun 17, 2022
Advanced raster and geometry manipulations

buzzard In a nutshell, the buzzard library provides powerful abstractions to manipulate together images and geometries that come from different kind o

Earthcube Lab 30 Jun 20, 2022
Summary statistics of geospatial raster datasets based on vector geometries.

rasterstats rasterstats is a Python module for summarizing geospatial raster datasets based on vector geometries. It includes functions for zonal stat

Matthew Perry 415 Jun 29, 2022
Raster-based Spatial Analysis for Python

?? xarray-spatial: Raster-Based Spatial Analysis in Python ?? Fast, Accurate Python library for Raster Operations ⚡ Extensible with Numba ⏩ Scalable w

makepath 588 Jun 21, 2022
Spatial Interpolation Toolbox is a Python-based GUI that is able to interpolate spatial data in vector format.

Spatial Interpolation Toolbox This is the home to Spatial Interpolation Toolbox, a graphical user interface (GUI) for interpolating geographic vector

Michael Ward 2 Nov 1, 2021
h3-js provides a JavaScript version of H3, a hexagon-based geospatial indexing system.

h3-js The h3-js library provides a pure-JavaScript version of the H3 Core Library, a hexagon-based geographic grid system. It can be used either in No

Uber Open Source 566 Jun 27, 2022
GebPy is a Python-based, open source tool for the generation of geological data of minerals, rocks and complete lithological sequences.

GebPy is a Python-based, open source tool for the generation of geological data of minerals, rocks and complete lithological sequences. The data can be generated randomly or with respect to user-defined constraints, for example a specific element concentration within minerals and rocks or the order of units within a complete lithological profile.

Maximilian Beeskow 11 Feb 13, 2022
A service to auto provision devices in Aruba Central based on the Geo-IP location

Location Based Provisioning Service for Aruba Central A service to auto provision devices in Aruba Central based on the Geo-IP location Geo-IP auto pr

Will Smith 3 Mar 22, 2022
Constraint-based geometry sketcher for blender

Constraint-based sketcher addon for Blender that allows to create precise 2d shapes by defining a set of geometric constraints like tangent, distance,

null 1.3k Jun 27, 2022
Blender Game Engine Game Type Templates Logic Bricks (and Python script) based Game Templates for Blender

Blender-Game-Engine-Templates Blender Game Engine Game Type Templates Logic Bric

null 2 Jan 8, 2022
Code for paper "Role-based network embedding via structural features reconstruction with degree-regularized constraint"

Role-based network embedding via structural features reconstruction with degree-regularized constraint Train python main.py --dataset brazil-flights

wang zhang 2 Nov 29, 2021
Blender addons to make the bridge between Blender and geographic data

Blender GIS Blender minimal version : 2.8 Mac users warning : currently the addon does not work on Mac with Blender 2.80 to 2.82. Please do not report

null 5.4k Jun 26, 2022
Blender addons - A collection of Blender tools I've written for myself over the years.

gret A collection of Blender tools I've written for myself over the years. I use these daily so they should be bug-free, mostly. Feel free to take and

null 169 Jun 21, 2022
Blender addon that enables exporting of xmodels from blender. Great for custom asset creation for cod games

Birdman's XModel Tools For Blender Greetings everyone in the custom cod community. This blender addon should finally enable exporting of custom assets

wast 1 Nov 22, 2021
Easytile blender - Simple Blender 2.83 addon for tiling meshes easily

easytile_blender Dead simple, barebones Blender (2.83) addon for placing meshes as tiles. Installation In Blender, go to Edit > Preferences > Add-ons

Sam Gibson 4 Jan 25, 2022
Fixed Version Of Blender Low Poly Rock Generator For Blender 3.0.0

Blender (3.0.0) - Low Poly Rock Generator This is an addon for Blender 3.0.0 to generate low poly rocks. It was based on an addon that unfortunately h

null 3 Mar 24, 2022
Rlmm blender toolkit - A set of tools to streamline level generation in UDK straight from Blender

rlmm_blender_toolkit A set of tools to streamline level generation in UDK straig

Rocket League Mapmaking 0 Jan 15, 2022
Blender-3D-SH-Dma-plugin - Import and export Sonic Heroes Delta Morph animations (.anm) into Blender 3D

io_scene_sonic_heroes_dma This plugin for Blender 3D allows you to import and ex

Psycrow 3 Mar 22, 2022
Blender-miHoYo-Shaders - Shaders for Blender attempting to replicate the shading of games developed by miHoYo

Blender-miHoYo-Shaders - Shaders for Blender attempting to replicate the shading of games developed by miHoYo

Matsuri 244 Jun 24, 2022
Official code for the paper: Deep Graph Matching under Quadratic Constraint (CVPR 2021)

QC-DGM This is the official PyTorch implementation and models for our CVPR 2021 paper: Deep Graph Matching under Quadratic Constraint. It also contain

Quankai Gao 45 Jun 28, 2022
Combining Reinforcement Learning and Constraint Programming for Combinatorial Optimization

Hybrid solving process for combinatorial optimization problems Combinatorial optimization has found applications in numerous fields, from aerospace to

null 106 Jun 29, 2022
OptaPy is an AI constraint solver for Python to optimize planning and scheduling problems.

OptaPy is an AI constraint solver for Python to optimize the Vehicle Routing Problem, Employee Rostering, Maintenance Scheduling, Task Assignment, School Timetabling, Cloud Optimization, Conference Scheduling, Job Shop Scheduling, Bin Packing and many more planning problems.

OptaPy 161 Jun 21, 2022
Robot Reinforcement Learning on the Constraint Manifold

Implementation of "Robot Reinforcement Learning on the Constraint Manifold"

null 15 Apr 16, 2022
0-1 knapsack with an additional constraint of maximum number of items used

extended_knapsack 0-1 knapsack with an additional constraint of maximum number of items used. Usage pip3 install extended_knapsack from extended_knaps

Lion Ralfs 1 Jan 6, 2022
ISBI 2022: Cross-level Contrastive Learning and Consistency Constraint for Semi-supervised Medical Image.

Cross-level Contrastive Learning and Consistency Constraint for Semi-supervised Medical Image Introduction This repository contains the PyTorch implem

null 20 Jun 7, 2022
Reusable constraint types to use with typing.Annotated

annotated-types PEP-593 added typing.Annotated as a way of adding context-specific metadata to existing types, and specifies that Annotated[T, x] shou

null 39 Jun 22, 2022
PyNIF3D is an open-source PyTorch-based library for research on neural implicit functions (NIF)-based 3D geometry representation.

PyNIF3D is an open-source PyTorch-based library for research on neural implicit functions (NIF)-based 3D geometry representation. It aims to accelerate research by providing a modular design that allows for easy extension and combination of NIF-related components, as well as readily available paper implementations and dataset loaders.

Preferred Networks, Inc. 96 Apr 20, 2022